Converts ID to the deliveryId needed for the confirmDelivery method of akka-persistence.
Converts ID to the deliveryId needed for the confirmDelivery method of akka-persistence.
In a simple orchestrator the same sequence (of the akka-persistence) is used for all the destinations of the orchestrator.
In a simple orchestrator the same sequence (of the akka-persistence) is used for all the destinations of the orchestrator. Because of this, ID = DeliveryId, and matchId only checks the deliveryId as that will be enough information to disambiguate which task should handle the response.
Override this method to add extra commands that are always handled by this orchestrator (except when recovering).
Override this method to add extra commands that are always handled by this orchestrator (except when recovering).
User overridable callback.
User overridable callback. Its called when a task instigates an abort. By default logs that the Orchestrator has aborted then stops it.
the task that instigated the abort.
the message that caused the abort.
Map with the tasks states at the moment of abort.
if you invoke become/unbecome inside this method, the contract that states "Tasks that are waiting will remain untouched and the orchestrator will still be prepared to handle their responses" will no longer be guaranteed.
User overridable callback.
User overridable callback. Its called once every task finishes. By default logs that the Orchestrator has finished then stops it.
You can use this to implement your termination strategy.
An Orchestrator without tasks never finishes.
Will cause the orchestrator to restart.
Will cause the orchestrator to restart. That is every task will become Unstarted and a StartReadyTasks will be sent to this orchestrator.
Restart can only be invoked if all tasks have finished or a task caused an abort. If there is a task that is still waiting invoking this method will throw an exception.
Roughly every X messages a snapshot will be saved.
Roughly every X messages a snapshot will be saved. Set to 0 to disable automatic saving of snapshots. By default this method returns the value defined in the configuration.
This is just a rough value because the orchestrator will not save it in the snapshots. In fact it will not save it at all. Instead the value of lastSequenceNr will be used to estimate how many messages have been processed.
You can trigger a save snapshot manually by sending a SaveSnapshot message to this orchestrator.
User overridable callback.
User overridable callback. Its called when recovery completes to start the Tasks.
By default logs that the orchestrator started and sends it the StartReadyTasks message.
You can override this to prevent the Orchestrator from starting right away.
However that strategy will only be effective the first time the orchestrator starts, that is,
if this orchestrator restarts with one task already finished, then that task will send the
StartReadyTasks so that tasks that depend on it can start.
(Since version 2.4) use persistAll instead
(Since version 2.4) use persistAllAsync instead
TODO: what to do when a task of the inner orchestrator aborts? abort the inner orchestrator and consequently the TaskBundle?