The behavior of this task.
The behavior of this task. This is akin to the receive method of an actor, except for the fact that an all catching pattern match will cause the orchestrator to fail. For example:
def behavior = Receive { case m => //Some code }
Will cause the orchestrator to fail.
The constructor of the message to be sent.
The ActorPath to whom this task will send the message(s).
whether this task status is Unstarted and all its dependencies have finished.
the current expected deliveryId of this Task.
Signals that this task has finished.
Signals that this task has finished.
the received message that signaled this task has finished.
whether this task status is Finished.
whether this task status is Waiting.
the correlationId obtained from the received message.
true if
· This task status is Waiting
· The actor path of the sender is the same as destination.
· The delivery id resolved from the correlation id is the expected delivery id for this task.
false otherwise.
Starts the execution of this task.
Starts the execution of this task. If this task is already Waiting or Finished an error will be logged.
We first persist that the message was sent, then we send it. If the Orchestrator is recovering then we just send the message because there is no need to persist that the message was sent.
the current status of this Task.
This will cause this task orchestrator to terminate early.
This will cause this task orchestrator to terminate early.
An early termination will have the following effects:
· This task will be finished.
· Every unstarted task will be prevented from starting even if its dependencies have finished.
· Tasks that are waiting will remain untouched and the orchestrator will
still be prepared to handle their responses.
· The method onEarlyTermination will be invoked in the orchestrator.
· The method onFinish will NEVER be called even if the only tasks needed to finish
the orchestrator are already waiting and the responses are received.
You can always call onFinish from inside onEarlyTermination to implement
the same termination strategy in both cases.
The TaskStatus representation of this task.
A task corresponds to sending a message to an actor, handling its response and possibly mutate the internal state of the Orchestrator. The answer(s) to the sent message must be handled in
behavior.behaviormust invokefinishwhen no further processing is necessary. The pattern matching insidebehaviorshould invokematchSenderAndIDto ensure the received message is in fact the one that we were waiting to receive. The internal state of the orchestrator might be mutated insidebehavior.This class is very tightly coupled with Orchestrator and the reverse is also true. Because of this you can only create instances of Task inside an orchestrator.