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
Nested Classes Modifier and Type Interface Description static class
GraphNode.Button
static class
GraphNode.EscalationRule
static class
GraphNode.Point
static class
GraphNode.State
The internal state of a node.static class
GraphNode.TaskInfo
static class
GraphNode.Transition
-
Field Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addTaskInfo(String taskId)
Persist the info when a new task is created from this nodeboolean
allowTaskReassignment()
Returns true if tasks created from this node can be reassigned.void
cancelSubRoute()
Cancels the sub-route if there is one.void
cancelTasks()
Cancels the tasks not ended on this node.boolean
canMerge()
Checks if the merge is ready to execute (enough input transitions are present).Date
computeTaskDueDate()
Evaluates the task due date from the taskDueDateExpr and sets it as the dueDatevoid
ending()
Does bookkeeping at node end.List<GraphNode.EscalationRule>
evaluateEscalationRules()
Evaluates the rules for the escalation rules and returns the ones to be executed.List<String>
evaluateTaskAssignees()
Evaluates the task assignees from the taskAssigneesVarList<GraphNode.Transition>
evaluateTransitions()
Evaluates transition conditions and returns the transitions that were true.void
executeChain(String chainId)
Executes an Automation chain in the context of this node.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 truevoid
executeTransitionChain(GraphNode.Transition transition)
Executes an Automation chain in the context of this node for a given transitionlong
getCanceledCount()
Gets the canceled count for this node.DocumentModel
getDocument()
Gets the document representing this nodeList<GraphNode.TaskInfo>
getEndedTasksInfo()
Gets all the ended tasks originating from this node.List<GraphNode.EscalationRule>
getEscalationRules()
Gets the list of all escalation rules for the nodeString
getId()
Get the node id.String
getInputChain()
Get input chain.List<GraphNode.Transition>
getInputTransitions()
Gets the input transitions.Map<String,Serializable>
getJsonVariables()
Gets a map containing the Json formatted variables currently defined on this nodeString
getOutputChain()
Get output chain.List<GraphNode.Transition>
getOutputTransitions()
Gets the output transitions.List<GraphNode.TaskInfo>
getProcessedTasksInfo()
Gets all the ended tasks originating from this node that were processed with a status.GraphNode.State
getState()
Get the node state.String
getSubRouteModelId()
Gets the sub-route model id.List<String>
getTaskAssignees()
Gets the task assigneesString
getTaskAssigneesPermission()
Gets the permission to the granted to the actors on this task on the document following the workflowList<GraphNode.Button>
getTaskButtons()
Gets the task buttonsString
getTaskDirective()
Gets the task directiveString
getTaskDocType()
Date
getTaskDueDate()
Gets the due dateString
getTaskDueDateExpr()
String
getTaskLayout()
Gets the task layoutString
getTaskNotificationTemplate()
List<GraphNode.TaskInfo>
getTasksInfo()
Gets all the tasks info for the tasks created from this nodeMap<String,Serializable>
getVariables()
Gets a map containing the variables currently defined on this nodeMap<String,Serializable>
getWorkflowContextualInfo(CoreSession session, boolean detached)
Gets a map containing the workflow and node variables and workflow documents.boolean
hasMultipleTasks()
Checks if this node has created multiple tasks, one for each assignees.boolean
hasOpenTasks()
Returns false if all tasks created from this node were ended.boolean
hasSubRoute()
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)
void
setAllVariables(Map<String,Object> map)
Sets the graph and node variables.void
setAllVariables(Map<String,Object> map, boolean allowGlobalVariablesAssignement)
Sets the graph and node variables.void
setButton(String status)
Sets the property button on the node, keeping the id of the last action executed by the user on the associated task if anyvoid
setCanceled()
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.DocumentRoute
startSubRoute()
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 Detail
-
MERGE_ONE
static final String MERGE_ONE
- See Also:
- Constant Field Values
-
MERGE_ALL
static final String MERGE_ALL
- See Also:
- Constant Field Values
-
PROP_NODE_ID
static final String PROP_NODE_ID
- See Also:
- Constant Field Values
-
PROP_TITLE
static final String PROP_TITLE
- See Also:
- Constant Field Values
-
PROP_FORK
static final String PROP_FORK
- See Also:
- Constant Field Values
-
PROP_START
static final String PROP_START
- See Also:
- Constant Field Values
-
PROP_STOP
static final String PROP_STOP
- See Also:
- Constant Field Values
-
PROP_MERGE
static final String PROP_MERGE
- See Also:
- Constant Field Values
-
PROP_COUNT
static final String PROP_COUNT
- See Also:
- Constant Field Values
-
PROP_CANCELED
static final String PROP_CANCELED
- See Also:
- Constant Field Values
-
PROP_INPUT_CHAIN
static final String PROP_INPUT_CHAIN
- See Also:
- Constant Field Values
-
PROP_OUTPUT_CHAIN
static final String PROP_OUTPUT_CHAIN
- See Also:
- Constant Field Values
-
PROP_HAS_TASK
static final String PROP_HAS_TASK
- See Also:
- Constant Field Values
-
PROP_VARIABLES_FACET
static final String PROP_VARIABLES_FACET
- See Also:
- Constant Field Values
-
PROP_TRANSITIONS
static final String PROP_TRANSITIONS
- See Also:
- Constant Field Values
-
PROP_TRANS_NAME
static final String PROP_TRANS_NAME
- See Also:
- Constant Field Values
-
PROP_TRANS_TARGET
static final String PROP_TRANS_TARGET
- See Also:
- Constant Field Values
-
PROP_TRANS_CONDITION
static final String PROP_TRANS_CONDITION
- See Also:
- Constant Field Values
-
PROP_TRANS_RESULT
static final String PROP_TRANS_RESULT
- See Also:
- Constant Field Values
-
PROP_TRANS_CHAIN
static final String PROP_TRANS_CHAIN
- See Also:
- Constant Field Values
-
PROP_TRANS_LABEL
static final String PROP_TRANS_LABEL
- See Also:
- Constant Field Values
-
PROP_TRANS_PATH
static final String PROP_TRANS_PATH
- Since:
- 7.1 a transition can hold a custom path
- See Also:
- Constant Field Values
-
PROP_TASK_ASSIGNEES
static final String PROP_TASK_ASSIGNEES
- See Also:
- Constant Field Values
-
PROP_TASK_ASSIGNEES_VAR
static final String PROP_TASK_ASSIGNEES_VAR
- See Also:
- Constant Field Values
-
PROP_TASK_ASSIGNEES_PERMISSION
static final String PROP_TASK_ASSIGNEES_PERMISSION
- See Also:
- Constant Field Values
-
PROP_TASK_DUE_DATE
static final String PROP_TASK_DUE_DATE
- See Also:
- Constant Field Values
-
PROP_TASK_DIRECTIVE
static final String PROP_TASK_DIRECTIVE
- See Also:
- Constant Field Values
-
PROP_TASK_LAYOUT
static final String PROP_TASK_LAYOUT
- See Also:
- Constant Field Values
-
PROP_TASK_BUTTONS
static final String PROP_TASK_BUTTONS
- See Also:
- Constant Field Values
-
PROP_BTN_NAME
static final String PROP_BTN_NAME
- See Also:
- Constant Field Values
-
PROP_BTN_LABEL
static final String PROP_BTN_LABEL
- See Also:
- Constant Field Values
-
PROP_BTN_FILTER
static final String PROP_BTN_FILTER
- See Also:
- Constant Field Values
-
PROP_BTN_VALIDATE
static final String PROP_BTN_VALIDATE
- See Also:
- Constant Field Values
-
PROP_NODE_X_COORDINATE
static final String PROP_NODE_X_COORDINATE
- See Also:
- Constant Field Values
-
PROP_NODE_Y_COORDINATE
static final String PROP_NODE_Y_COORDINATE
- See Also:
- Constant Field Values
-
PROP_NODE_BUTTON
static final String 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:
- Constant Field Values
-
PROP_NODE_START_DATE
static final String PROP_NODE_START_DATE
- See Also:
- Constant Field Values
-
PROP_NODE_END_DATE
static final String PROP_NODE_END_DATE
- See Also:
- Constant Field Values
-
PROP_NODE_LAST_ACTOR
static final String PROP_NODE_LAST_ACTOR
- See Also:
- Constant Field Values
-
PROP_TASK_DOC_TYPE
static final String PROP_TASK_DOC_TYPE
- See Also:
- Constant Field Values
-
PROP_TASK_NOTIFICATION_TEMPLATE
static final String PROP_TASK_NOTIFICATION_TEMPLATE
- See Also:
- Constant Field Values
-
PROP_TASK_DUE_DATE_EXPR
static final String PROP_TASK_DUE_DATE_EXPR
- See Also:
- Constant Field Values
-
PROP_EXECUTE_ONLY_FIRST_TRANSITION
static final String PROP_EXECUTE_ONLY_FIRST_TRANSITION
- Since:
- 5.7.2
- See Also:
- Constant Field Values
-
PROP_SUB_ROUTE_MODEL_EXPR
static final String PROP_SUB_ROUTE_MODEL_EXPR
The sub-route model id (expression) to run, if present.- Since:
- 5.7.2
- See Also:
- Constant Field Values
-
PROP_SUB_ROUTE_INSTANCE_ID
static final String PROP_SUB_ROUTE_INSTANCE_ID
The sub-route instance id being run while this node is suspended.- Since:
- 5.7.2
- See Also:
- Constant Field Values
-
PROP_SUB_ROUTE_VARS
static final String PROP_SUB_ROUTE_VARS
The sub-route variables to set (key/value list).- Since:
- 5.7.2
- See Also:
- Constant Field Values
-
PROP_KEYVALUE_KEY
static final String PROP_KEYVALUE_KEY
- Since:
- 5.7.2
- See Also:
- Constant Field Values
-
PROP_KEYVALUE_VALUE
static final String PROP_KEYVALUE_VALUE
- Since:
- 5.7.2
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULES
static final String PROP_ESCALATION_RULES
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULE_ID
static final String PROP_ESCALATION_RULE_ID
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULE_LABEL
static final String PROP_ESCALATION_RULE_LABEL
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULE_MULTIPLE_EXECUTION
static final String PROP_ESCALATION_RULE_MULTIPLE_EXECUTION
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULE_CONDITION
static final String PROP_ESCALATION_RULE_CONDITION
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULE_CHAIN
static final String PROP_ESCALATION_RULE_CHAIN
- See Also:
- Constant Field Values
-
PROP_ESCALATION_RULE_EXECUTED
static final String PROP_ESCALATION_RULE_EXECUTED
- See Also:
- Constant Field Values
-
PROP_LAST_EXECUTION_TIME
static final String PROP_LAST_EXECUTION_TIME
- See Also:
- Constant Field Values
-
PROP_HAS_MULTIPLE_TASKS
static final String PROP_HAS_MULTIPLE_TASKS
- See Also:
- Constant Field Values
-
PROP_TASKS_INFO
static final String PROP_TASKS_INFO
- See Also:
- Constant Field Values
-
PROP_TASK_INFO_ACTOR
static final String PROP_TASK_INFO_ACTOR
- See Also:
- Constant Field Values
-
PROP_TASK_INFO_COMMENT
static final String PROP_TASK_INFO_COMMENT
- See Also:
- Constant Field Values
-
PROP_TASK_INFO_STATUS
static final String PROP_TASK_INFO_STATUS
- See Also:
- Constant Field Values
-
PROP_TASK_INFO_ENDED
static final String PROP_TASK_INFO_ENDED
- See Also:
- Constant Field Values
-
PROP_TASK_INFO_TASK_DOC_ID
static final String PROP_TASK_INFO_TASK_DOC_ID
- See Also:
- Constant Field Values
-
PROP_ALLOW_TASK_REASSIGNMENT
static final String PROP_ALLOW_TASK_REASSIGNMENT
- See Also:
- Constant Field Values
-
NODE_VARIABLE_COMMENT
static final String NODE_VARIABLE_COMMENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getState
GraphNode.State getState()
Get the node state.- Returns:
- the node state
-
setState
void setState(GraphNode.State state)
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
List<String> 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
void executeChain(String chainId) throws DocumentRouteException
Executes an Automation chain in the context of this node.- Parameters:
chainId
- the chain- Throws:
DocumentRouteException
-
initAddInputTransition
void initAddInputTransition(GraphNode.Transition transition)
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
void executeTransitionChain(GraphNode.Transition transition) throws DocumentRouteException
Executes an Automation chain in the context of this node for a given transition- Parameters:
transition
- the transition- Throws:
DocumentRouteException
-
evaluateTransitions
List<GraphNode.Transition> evaluateTransitions() throws DocumentRouteException
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
void setAllVariables(Map<String,Object> map)
Sets the graph and node variables.- Parameters:
map
- the map of variables
-
setAllVariables
void setAllVariables(Map<String,Object> map, boolean allowGlobalVariablesAssignement)
Sets the graph and node variables.- Parameters:
map
- the map of variablesallowGlobalVariablesAssignement
- if set to false, throw a DocumentRouteException when trying to set global variables when not supposed to- Since:
- 7.2
-
getTaskButtons
List<GraphNode.Button> getTaskButtons()
Gets the task buttons
-
hasTaskButton
boolean hasTaskButton(String name)
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
void setButton(String status)
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
void setLastActor(String actor)
Sets the last actor on a node (user who completed the task).- Parameters:
actor
- the user id
-
evaluateTaskAssignees
List<String> evaluateTaskAssignees() throws DocumentRouteException
Evaluates the task assignees from the taskAssigneesVar- Throws:
DocumentRouteException
-
computeTaskDueDate
Date computeTaskDueDate() throws DocumentRouteException
Evaluates the task due date from the taskDueDateExpr and sets it as the dueDate- Throws:
DocumentRouteException
-
getWorkflowContextualInfo
Map<String,Serializable> getWorkflowContextualInfo(CoreSession session, boolean detached)
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
boolean hasSubRoute() throws DocumentRouteException
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
String getSubRouteModelId() throws DocumentRouteException
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
DocumentRoute startSubRoute() throws DocumentRouteException
Starts the sub-route on this node.- Returns:
- the sub-route
- Throws:
DocumentRouteException
- Since:
- 5.7.2
-
cancelSubRoute
void cancelSubRoute() throws DocumentRouteException
Cancels the sub-route if there is one.- Throws:
DocumentRouteException
- Since:
- 5.7.2
-
evaluateEscalationRules
List<GraphNode.EscalationRule> evaluateEscalationRules()
Evaluates 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
void addTaskInfo(String taskId)
Persist the info when a new task is created from this node- Since:
- 5.7.3
-
updateTaskInfo
void updateTaskInfo(String taskId, boolean ended, String status, String actor, String comment)
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
void setVariable(String name, String value)
Sets the variable on this node if it exists as a Node Variable.- Since:
- 5.8
-
setVariables
void setVariables(Map<String,Serializable> map)
Sets the node variables.- Parameters:
map
- the map of variables- Since:
- 5.9.3, 5.8.0-HF11
-
setJSONVariables
void setJSONVariables(Map<String,String> map)
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
void removeTaskInfo(String taskId)
- Since:
- 7.4
-
-