Domain Operations
This page lists the various operations that are available on the global domain level as static method calls.
passivate: Unload a flow from memory
This will stop a flow instance (even if it’s not reached a terminal state) to save some memory, if it is known that it has reached a long-running step, for example.
Note that messages directed at this instance will still be delivered, but IPF will reload the events of that flow from the journal instead of having them already stored in memory.
The call is:
XxxDomain.passivate("MyBehaviour|some-id-23149082");
Where Xxx is the name of the IPF solution containing the relevant flow, and MyBehaviour is the name of the flow itself.
getAggregate: Get a flow’s aggregate (state)
To retrieve the current state of a flow instance, you can call:
XxxDomain.getAggregate("MyBehaviour|some-id-23149082");
This will return a CompletionStage<Aggregate>
which completes when the aggregate is returned.
The Aggregate will be of the type MyBehaviourAggregate which will contain:
-
The current status
-
The last failure reason code(s)/description(s)
-
All business data
-
All events
|
Do not use
If the load is significant enough, the actor will be burdened by servicing If you find that you need to use |
getStatus: Get a flow’s status
This operation is similar to that above, but will only return the current status.
Also returns as a CompletionStage<AggregateStatus>.
To retrieve the status:
XxxDomain.getStatus("MyBehaviour|some-id-23149082");
abort: Stop a flow’s execution
This command takes a reason argument and:
-
Sets the flow’s status to
ABORTED -
Sets the resulting status to
Aborted -
Publishes an
AbortedEventwith the reason specified in the call -
Cancels all scheduled tasks related to this flow
To abort a flow:
XxxDomain.abort("MyBehaviour|some-id-23149082", "some special reason");
Once a flow has been aborted, it cannot be resumed, even with the resume function below.
|
resume: Continue a flow’s execution
This operation will invoke the action revival process for a flow to attempt to move a transaction that appears to be stuck onto the next state.
Note that this operation cannot resume aborted transactions.
To resume a flow:
XxxDomain.resume("MyBehaviour|some-id-23149082");