public interface Node
Node corresponds to an action in a workflow definition. E.g. it may
perform some function. In some cases it may not complete immediately, but
enter a wait state. At some point it will be completed and the execution can
continue.
Every node may have multiple outgoing Transitions. When a node is
completed, it may pick which transition(s) to proceed trough.
Note, that node implementations may not contain any GraphInstance
specific execution state. If a node implementation requires such state, this
state either must reside in the Token implementation or in the
graph instance's Environment.
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(GraphEngine engine,
Token token)
Called when the
GraphEngine cancels the execution of a
Token, that is currently pointing to this node and is in a wait
state. |
void |
execute(GraphEngine engine,
Token token)
Performs node specific logic.
|
int |
getId()
Returns the node's unique id.
|
String |
getName()
Returns the node's name.
|
void |
store(Environment environment,
Object result)
When a token execution on a node completes and returns control back to
the engine, then the engine mandates the node to store the node execution
result into the graph instance's environment.
|
int getId()
Graph.String getName()
void execute(GraphEngine engine, Token token)
GraphEngineFacade#complete(WorkItem) method
must be called to continue executing the GraphInstance.engine - the GraphEngine which is performing the executiontoken - the Token which is currently executing in this nodevoid cancel(GraphEngine engine, Token token)
GraphEngine cancels the execution of a
Token, that is currently pointing to this node and is in a wait
state.engine - the GraphEngine which is performing the executiontoken - the Token pointing to this nodevoid store(Environment environment, Object result)
environment - the environment to store the result inresult - the result to be storedCopyright © 2018. All rights reserved.