Interface GraphNode
- All Known Implementing Classes:
GraphNodeImpl
public interface GraphNode
A node for a route graph. Represents operation chains, associated task and form, output transitions and their
conditions, etc.
- Since:
- 5.6
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
static class
static enum
The internal state of a node.static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
The sub-route instance id being run while this node is suspended.static final String
The sub-route model id (expression) to run, if present.static final String
The sub-route variables to set (key/value list).static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTaskInfo
(String taskId) Persist the info when a new task is created from this nodeboolean
Returns true if tasks created from this node can be reassigned.void
Cancels the sub-route if there is one.void
Cancels the tasks not ended on this node.boolean
canMerge()
Checks if the merge is ready to execute (enough input transitions are present).Evaluates the task due date from the taskDueDateExpr and sets it as the dueDatevoid
ending()
Does bookkeeping at node end.Deprecated.Evaluates the task assignees from the taskAssigneesVarEvaluates transition conditions and returns the transitions that were true.void
executeChain
(String chainId) Executes an Automation chain in the context of this node.boolean
When workflow engine runs an exclusive node, it evaluates the transition one by one and stops a soon as one of the transition is evaluated to truevoid
executeTransitionChain
(GraphNode.Transition transition) Executes an Automation chain in the context of this node for a given transitionlong
Gets the canceled count for this node.Gets the document representing this nodeGets all the ended tasks originating from this node.Gets the list of all escalation rules for the nodegetGraph()
getId()
Get the node id.Get input chain.Gets the input transitions.Gets a map containing the Json formatted variables currently defined on this nodeGet output chain.Gets the output transitions.Gets all the ended tasks originating from this node that were processed with a status.getState()
Get the node state.Gets the sub-route model id.Gets the task assigneesGets the permission to the granted to the actors on this task on the document following the workflowGets the task buttonsGets the task directiveGets the due dateGets the task layoutGets all the tasks info for the tasks created from this nodeGets a map containing the variables currently defined on this nodegetWorkflowContextualInfo
(CoreSession session, boolean detached) Gets a map containing the workflow and node variables and workflow documents.boolean
Checks if this node has created multiple tasks, one for each assignees.boolean
Returns false if all tasks created from this node were ended.boolean
Checks if this node has a sub-route model defined.boolean
hasTask()
Checks it this node has an associated user task.boolean
hasTaskButton
(String name) Has the node the given action.void
initAddInputTransition
(GraphNode.Transition transition) Internal during graph init.boolean
isFork()
Checks if this is a fork node.boolean
isMerge()
Checks if this is a merge node.boolean
isStart()
Checks if this is the start node.boolean
isStop()
Checks if this is a stop node.void
removeTaskInfo
(String taskId) default void
setAllVariables
(Map<String, Object> map) Sets the graph and node variables.default void
setAllVariables
(Map<String, Object> map, boolean allowGlobalVariablesAssignment) Sets the graph and node variables.void
setAllVariables
(Map<String, Object> map, boolean allowGlobalVariablesAssignment, boolean save) Sets the graph and node variables.void
Sets the property button on the node, keeping the id of the last action executed by the user on the associated task if anyvoid
Notes that this node was canceled (increments canceled counter).void
setJSONVariables
(Map<String, String> map) Sets the variables of the workflow based on their JSON representation (especially for scalar lists).void
setLastActor
(String actor) Sets the last actor on a node (user who completed the task).void
setState
(GraphNode.State state) Set the node state.void
setVariable
(String name, String value) Sets the variable on this node if it exists as a Node Variable.void
setVariables
(Map<String, Serializable> map) Sets the node variables.void
starting()
Does bookkeeping at node start.Starts the sub-route on this node.void
updateTaskInfo
(String taskId, boolean ended, String status, String actor, String comment) Persist these info from the task on the node.
-
Field Details
-
MERGE_ONE
- See Also:
-
MERGE_ALL
- See Also:
-
PROP_NODE_ID
- See Also:
-
PROP_TITLE
- See Also:
-
PROP_FORK
- See Also:
-
PROP_START
- See Also:
-
PROP_STOP
- See Also:
-
PROP_MERGE
- See Also:
-
PROP_COUNT
- See Also:
-
PROP_CANCELED
- See Also:
-
PROP_INPUT_CHAIN
- See Also:
-
PROP_OUTPUT_CHAIN
- See Also:
-
PROP_HAS_TASK
- See Also:
-
PROP_VARIABLES_FACET
- See Also:
-
PROP_TRANSITIONS
- See Also:
-
PROP_TRANS_NAME
- See Also:
-
PROP_TRANS_TARGET
- See Also:
-
PROP_TRANS_CONDITION
- See Also:
-
PROP_TRANS_RESULT
- See Also:
-
PROP_TRANS_CHAIN
- See Also:
-
PROP_TRANS_LABEL
- See Also:
-
PROP_TRANS_PATH
- Since:
- 7.1 a transition can hold a custom path
- See Also:
-
PROP_TASK_ASSIGNEES
- See Also:
-
PROP_TASK_ASSIGNEES_VAR
- See Also:
-
PROP_TASK_ASSIGNEES_PERMISSION
- See Also:
-
PROP_TASK_DUE_DATE
- See Also:
-
PROP_TASK_DIRECTIVE
- See Also:
-
PROP_TASK_LAYOUT
- See Also:
-
PROP_TASK_BUTTONS
- See Also:
-
PROP_BTN_NAME
- See Also:
-
PROP_BTN_LABEL
- See Also:
-
PROP_BTN_FILTER
- See Also:
-
PROP_BTN_VALIDATE
- See Also:
-
PROP_NODE_X_COORDINATE
- See Also:
-
PROP_NODE_Y_COORDINATE
- See Also:
-
PROP_NODE_BUTTON
- Since:
- 5.7.3 a node can create multiple tasks, in this case, this stores the status of the last task ended
- See Also:
-
PROP_NODE_START_DATE
- See Also:
-
PROP_NODE_END_DATE
- See Also:
-
PROP_NODE_LAST_ACTOR
- See Also:
-
PROP_TASK_DOC_TYPE
- See Also:
-
PROP_TASK_NOTIFICATION_TEMPLATE
- See Also:
-
PROP_TASK_DUE_DATE_EXPR
- See Also:
-
PROP_EXECUTE_ONLY_FIRST_TRANSITION
- Since:
- 5.7.2
- See Also:
-
PROP_SUB_ROUTE_MODEL_EXPR
The sub-route model id (expression) to run, if present.- Since:
- 5.7.2
- See Also:
-
PROP_SUB_ROUTE_INSTANCE_ID
The sub-route instance id being run while this node is suspended.- Since:
- 5.7.2
- See Also:
-
PROP_SUB_ROUTE_VARS
The sub-route variables to set (key/value list).- Since:
- 5.7.2
- See Also:
-
PROP_KEYVALUE_KEY
- Since:
- 5.7.2
- See Also:
-
PROP_KEYVALUE_VALUE
- Since:
- 5.7.2
- See Also:
-
PROP_ESCALATION_RULES
- See Also:
-
PROP_ESCALATION_RULE_ID
- See Also:
-
PROP_ESCALATION_RULE_LABEL
- See Also:
-
PROP_ESCALATION_RULE_MULTIPLE_EXECUTION
- See Also:
-
PROP_ESCALATION_RULE_CONDITION
- See Also:
-
PROP_ESCALATION_RULE_CHAIN
- See Also:
-
PROP_ESCALATION_RULE_EXECUTED
- See Also:
-
PROP_LAST_EXECUTION_TIME
- See Also:
-
PROP_HAS_MULTIPLE_TASKS
- See Also:
-
PROP_TASKS_INFO
- See Also:
-
PROP_TASK_INFO_ACTOR
- See Also:
-
PROP_TASK_INFO_COMMENT
- See Also:
-
PROP_TASK_INFO_STATUS
- See Also:
-
PROP_TASK_INFO_ENDED
- See Also:
-
PROP_TASK_INFO_TASK_DOC_ID
- See Also:
-
PROP_ALLOW_TASK_REASSIGNMENT
- See Also:
-
NODE_VARIABLE_COMMENT
- See Also:
-
-
Method Details
-
getId
String getId()Get the node id.- Returns:
- the node id
-
getGraph
GraphRoute getGraph()- Since:
- 2023.0
-
getState
GraphNode.State getState()Get the node state.- Returns:
- the node state
-
setState
Set the node state.- Parameters:
state
- the node state
-
isFork
boolean isFork()Checks if this is a fork node.- Since:
- 11.1
-
isStart
boolean isStart()Checks if this is the start node. -
isStop
boolean isStop()Checks if this is a stop node. -
isMerge
boolean isMerge()Checks if this is a merge node. -
canMerge
boolean canMerge()Checks if the merge is ready to execute (enough input transitions are present). -
setCanceled
void setCanceled()Notes that this node was canceled (increments canceled counter). -
getCanceledCount
long getCanceledCount()Gets the canceled count for this node. -
cancelTasks
void cancelTasks()Cancels the tasks not ended on this node. -
getInputChain
String getInputChain()Get input chain.- Returns:
- the input chain
-
getOutputChain
String getOutputChain()Get output chain.- Returns:
- the output chain
-
hasTask
boolean hasTask()Checks it this node has an associated user task. -
getTaskAssignees
Gets the task assignees- Returns:
- the task assignees
-
getTaskDueDate
Date getTaskDueDate()Gets the due date -
getTaskDirective
String getTaskDirective()Gets the task directive -
getTaskAssigneesPermission
String getTaskAssigneesPermission()Gets the permission to the granted to the actors on this task on the document following the workflow -
getTaskLayout
String getTaskLayout()Gets the task layout -
getTaskDocType
String getTaskDocType()- Returns:
- the taskDocType. If none is specified, the default task type is returned.
-
getTaskNotificationTemplate
String getTaskNotificationTemplate() -
starting
void starting()Does bookkeeping at node start. -
ending
void ending()Does bookkeeping at node end. -
executeChain
Executes an Automation chain in the context of this node.- Parameters:
chainId
- the chain- Throws:
DocumentRouteException
-
initAddInputTransition
Internal during graph init. -
getInputTransitions
List<GraphNode.Transition> getInputTransitions()Gets the input transitions. -
getOutputTransitions
List<GraphNode.Transition> getOutputTransitions()Gets the output transitions. -
getTaskDueDateExpr
String getTaskDueDateExpr() -
executeTransitionChain
Executes an Automation chain in the context of this node for a given transition- Parameters:
transition
- the transition- Throws:
DocumentRouteException
-
evaluateTransitions
Evaluates transition conditions and returns the transitions that were true.Transitions are evaluated in the order set on the node when the workflow was designed. Since @5.7.2 if the node has the property "executeOnlyFirstTransition" set to true, only the first transition evaluated to true is returned
- Returns:
- the true transitions
- Throws:
DocumentRouteException
-
setAllVariables
Sets the graph and node variables.- Parameters:
map
- the map of variables
-
setAllVariables
Sets the graph and node variables.- Parameters:
map
- the map of variablesallowGlobalVariablesAssignment
- if set to false, throw a DocumentRouteException when trying to set global variables when not supposed to- Since:
- 7.2
-
setAllVariables
Sets the graph and node variables.- Parameters:
map
- the map of variablesallowGlobalVariablesAssignment
- if set to false, throw a DocumentRouteException when trying to set global variables when not supposed tosave
- whether to save the document after setting the variables- Since:
- 2023.0
-
getTaskButtons
List<GraphNode.Button> getTaskButtons()Gets the task buttons -
hasTaskButton
Has the node the given action.- Since:
- 7.2
-
getDocument
DocumentModel getDocument()Gets the document representing this node -
getVariables
Map<String,Serializable> getVariables()Gets a map containing the variables currently defined on this node -
getJsonVariables
Map<String,Serializable> getJsonVariables()Gets a map containing the Json formatted variables currently defined on this node- Since:
- 7.2
-
setButton
Sets the property button on the node, keeping the id of the last action executed by the user on the associated task if any -
setLastActor
Sets the last actor on a node (user who completed the task).- Parameters:
actor
- the user id
-
evaluateTaskAssignees
Evaluates the task assignees from the taskAssigneesVar- Throws:
DocumentRouteException
-
computeTaskDueDate
Evaluates the task due date from the taskDueDateExpr and sets it as the dueDate- Throws:
DocumentRouteException
-
getWorkflowContextualInfo
Gets a map containing the workflow and node variables and workflow documents.- Parameters:
detached
- The documents added into this map can be detached or not
-
executeOnlyFirstTransition
boolean executeOnlyFirstTransition()When workflow engine runs an exclusive node, it evaluates the transition one by one and stops a soon as one of the transition is evaluated to true- Since:
- 5.7.2
-
hasSubRoute
Checks if this node has a sub-route model defined.- Returns:
true
if there is a sub-route- Throws:
DocumentRouteException
- Since:
- 5.7.2
-
getSubRouteModelId
Gets the sub-route model id.If this is present, then this node will be suspended while the sub-route is run. When the sub-route ends, this node will resume.
- Returns:
- the sub-route id, or
null
if none is defined - Throws:
DocumentRouteException
- Since:
- 5.7.2
-
startSubRoute
Starts the sub-route on this node.- Returns:
- the sub-route
- Throws:
DocumentRouteException
- Since:
- 5.7.2
-
cancelSubRoute
Cancels the sub-route if there is one.- Throws:
DocumentRouteException
- Since:
- 5.7.2
-
evaluateEscalationRules
Deprecated.since 2023.0, useDocumentRoutingEscalationService.computeEscalationRulesToExecute(GraphNode)
insteadEvaluates the rules for the escalation rules and returns the ones to be executed. The rules already executed and not having the property multipleExecution = true are also ignored- Since:
- 5.7.2
-
getEscalationRules
List<GraphNode.EscalationRule> getEscalationRules()Gets the list of all escalation rules for the node- Since:
- 5.7.2
-
hasMultipleTasks
boolean hasMultipleTasks()Checks if this node has created multiple tasks, one for each assignees.- Since:
- 5.7.3
-
getTasksInfo
List<GraphNode.TaskInfo> getTasksInfo()Gets all the tasks info for the tasks created from this node- Since:
- 5.7.3
-
addTaskInfo
Persist the info when a new task is created from this node- Since:
- 5.7.3
-
updateTaskInfo
Persist these info from the task on the node. Status is the id of the button clicked to end the task by the actor.- Since:
- 5.7.3
-
getEndedTasksInfo
List<GraphNode.TaskInfo> getEndedTasksInfo()Gets all the ended tasks originating from this node. This also counts the canceled tasks.- Since:
- 5.7.3
-
getProcessedTasksInfo
List<GraphNode.TaskInfo> getProcessedTasksInfo()Gets all the ended tasks originating from this node that were processed with a status. Doesn't count the canceled tasks.- Since:
- 5.7.3
-
hasOpenTasks
boolean hasOpenTasks()Returns false if all tasks created from this node were ended.- Since:
- 5.7.3
-
allowTaskReassignment
boolean allowTaskReassignment()Returns true if tasks created from this node can be reassigned.- Since:
- 5.7.3
-
setVariable
Sets the variable on this node if it exists as a Node Variable.- Since:
- 5.8
-
setVariables
Sets the node variables.- Parameters:
map
- the map of variables- Since:
- 5.9.3, 5.8.0-HF11
-
setJSONVariables
Sets the variables of the workflow based on their JSON representation (especially for scalar lists). For example:Map<String, String> map = new HashMap<>(); map.put("contributors", "[\"John Doe\", \"John Smith\"]"); map.put("title", "Test Title");
- Parameters:
map
- the map of variables- Since:
- 5.9.3, 5.8.0-HF11
-
removeTaskInfo
- Since:
- 7.4
-
DocumentRoutingEscalationService.computeEscalationRulesToExecute(GraphNode)
instead