public interface GraphEngine extends GraphEngineFacade
GraphEngine is the interface that is internally used used to
communicated with a graph engine.| Modifier and Type | Method and Description |
|---|---|
GraphWorkItem |
addHumanTaskItem(GraphInstance instance,
Token token,
String role,
String user,
Map<String,Object> arguments)
Adds a new
HumanTaskItem to the given instance which is
associated to the given token. |
GraphWorkItem |
addSignalItem(GraphInstance instance,
Token token,
String signal)
Adds a new
SignalItem to the given instance which is associated
to the given token. |
GraphWorkItem |
addTaskItem(GraphInstance instance,
Token token,
String bean,
String method,
Object[] arguments)
Adds a new
TaskItem to the given instance which is associated to
the given token. |
GraphWorkItem |
addTimerItem(GraphInstance instance,
Token token,
Date dueDate)
Adds a new
TimerItem to the given instance which is associated to
the given token. |
Token |
addToken(GraphInstance instance,
Node node,
Token parent)
Adds a new, active token to the given instance pointing to the given node
with the given parent.
|
void |
cancel(Token token)
Cancels the given token.
|
void |
cancelWorkItem(Token token)
If existent, cancels the active work item associated with the given
token.
|
void |
complete(Token token,
Object result)
A shorthand for
complete(Token, Object, String) using a the
default transition name Transition.DEFAULT_TRANSITION_NAME. |
void |
complete(Token token,
Object result,
String transitionName)
|
void |
terminate(Token token)
Marks the given token and all direct parent tokens active that do not
have any further active child tokens.
|
abort, complete, getBeanResolver, getNewGraphInstanceCreator, getRepository, registerInstanceEventListener, registerNodeEventListener, registerWorkItemEventListener, start, start, start, start, start, start, startToken addToken(GraphInstance instance, Node node, Token parent)
instance - the instance to add tonode - the node that the new token will point toparent - the new token's parent tokenGraphWorkItem addSignalItem(GraphInstance instance, Token token, String signal)
SignalItem to the given instance which is associated
to the given token. The SignalItem is awaiting a signal with the
given name.instance - the instance to add the new signal item totoken - the token to associate the signal item withsignal - the signal's name to wait forGraphWorkItem addTimerItem(GraphInstance instance, Token token, Date dueDate)
TimerItem to the given instance which is associated to
the given token. The TimerItem is awaiting the given dueDate.instance - the instance to add the new timer item totoken - the token to associate the timer item withdueDate - the due date to wait forGraphWorkItem addTaskItem(GraphInstance instance, Token token, String bean, String method, Object[] arguments)
TaskItem to the given instance which is associated to
the given token. The TaskItem is awaiting external execution.instance - the instance to add the new task item totoken - the token to associate the task item withbean - the bean to call a method onmethod - the method to call toarguments - the method call's argumentsGraphWorkItem addHumanTaskItem(GraphInstance instance, Token token, String role, String user, Map<String,Object> arguments)
HumanTaskItem to the given instance which is
associated to the given token. The HumanTaskItem is awaiting
external resolution.instance - the instance to add the new human task item totoken - the token to associate the human task item withrole - the role a user must be assigned to resolve the given taskuser - the user the task is assigned to or null if the
assignment is role based.arguments - the task argumentsvoid cancelWorkItem(Token token)
void complete(Token token, Object result)
complete(Token, Object, String) using a the
default transition name Transition.DEFAULT_TRANSITION_NAME.void complete(Token token, Object result, String transitionName)
Token's current Node
on the associated GraphInstance. The method will take the
required steps to merge the given result into the graph instance's
Environment and to continue the token's execution along the
Transition with the given name.
If a call to Node.execute(GraphEngine, Token) does not contain a
call to this method, then the token's execution halts at that point. This
is generally referred to as a wait state. This occurs, for example, if
the action represented by that node must be done by a human or some
external system.
When the external system has determined that the Node has
completed its work, it should invoke
GraphEngineFacade#complete(WorkItem) to continue executing the
graph instance.
token - The token to continue execution onresult - The result of the node executiontransitionName - The transition's name along which to continue executionvoid cancel(Token token)
Node.cancel(GraphEngine, Token) on the node that this token is
currently pointing to.void terminate(Token token)
Copyright © 2018. All rights reserved.