public class GraphNodeImpl extends DocumentRouteElementImpl implements GraphNode
DocumentRouteElementImpl.GetIsParentRunningUnrestricted, DocumentRouteElementImpl.SetDocumentOnReadOnlyUnrestrictedSessionRunnerGraphNode.Button, GraphNode.EscalationRule, GraphNode.Point, GraphNode.State, GraphNode.TaskInfo, GraphNode.TransitionDocumentRouteElement.ElementLifeCycleState, DocumentRouteElement.ElementLifeCycleTransistion| Modifier and Type | Field and Description |
|---|---|
protected List<GraphNode.EscalationRule> |
escalationRules |
protected GraphRouteImpl |
graph |
protected List<GraphNode.Transition> |
inputTransitions
To be used through getter.
|
protected GraphNode.State |
localState |
protected List<GraphNode.Transition> |
outputTransitions
To be used through getter.
|
protected List<GraphNode.Button> |
taskButtons
To be used through getter.
|
protected List<GraphNode.TaskInfo> |
tasksInfo |
document, runnerMERGE_ALL, MERGE_ONE, NODE_VARIABLE_COMMENT, PROP_ALLOW_TASK_REASSIGNMENT, PROP_BTN_FILTER, PROP_BTN_LABEL, PROP_BTN_NAME, PROP_BTN_VALIDATE, PROP_CANCELED, PROP_COUNT, PROP_ESCALATION_RULE_CHAIN, PROP_ESCALATION_RULE_CONDITION, PROP_ESCALATION_RULE_EXECUTED, PROP_ESCALATION_RULE_ID, PROP_ESCALATION_RULE_LABEL, PROP_ESCALATION_RULE_MULTIPLE_EXECUTION, PROP_ESCALATION_RULES, PROP_EXECUTE_ONLY_FIRST_TRANSITION, PROP_HAS_MULTIPLE_TASKS, PROP_HAS_TASK, PROP_INPUT_CHAIN, PROP_KEYVALUE_KEY, PROP_KEYVALUE_VALUE, PROP_LAST_EXECUTION_TIME, PROP_MERGE, PROP_NODE_BUTTON, PROP_NODE_END_DATE, PROP_NODE_ID, PROP_NODE_LAST_ACTOR, PROP_NODE_START_DATE, PROP_NODE_X_COORDINATE, PROP_NODE_Y_COORDINATE, PROP_OUTPUT_CHAIN, PROP_START, PROP_STOP, PROP_SUB_ROUTE_INSTANCE_ID, PROP_SUB_ROUTE_MODEL_EXPR, PROP_SUB_ROUTE_VARS, PROP_TASK_ASSIGNEES, PROP_TASK_ASSIGNEES_PERMISSION, PROP_TASK_ASSIGNEES_VAR, PROP_TASK_BUTTONS, PROP_TASK_DIRECTIVE, PROP_TASK_DOC_TYPE, PROP_TASK_DUE_DATE, PROP_TASK_DUE_DATE_EXPR, PROP_TASK_INFO_ACTOR, PROP_TASK_INFO_COMMENT, PROP_TASK_INFO_ENDED, PROP_TASK_INFO_STATUS, PROP_TASK_INFO_TASK_DOC_ID, PROP_TASK_LAYOUT, PROP_TASK_NOTIFICATION_TEMPLATE, PROP_TASKS_INFO, PROP_TITLE, PROP_TRANS_CHAIN, PROP_TRANS_CONDITION, PROP_TRANS_LABEL, PROP_TRANS_NAME, PROP_TRANS_PATH, PROP_TRANS_RESULT, PROP_TRANS_TARGET, PROP_TRANSITIONS, PROP_VARIABLES_FACET| Constructor and Description |
|---|
GraphNodeImpl(DocumentModel doc) |
GraphNodeImpl(DocumentModel doc,
GraphRouteImpl graph) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTaskAssignees(List<String> taskAssignees) |
void |
addTaskInfo(String taskId)
Persist the info when a new task is created from this node
|
boolean |
allowTaskReassignment()
Returns true if tasks created from this node can be reassigned.
|
void |
cancelSubRoute()
Cancels the sub-route if there is one.
|
protected void |
cancelTask(CoreSession session,
String taskId) |
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).
|
protected List<GraphNode.EscalationRule> |
computeEscalationRules() |
protected List<GraphNode.Transition> |
computeOutputTransitions() |
protected List<GraphNode.Button> |
computeTaskButtons() |
Date |
computeTaskDueDate()
Evaluates the task due date from the taskDueDateExpr and sets it as the dueDate
|
protected List<GraphNode.TaskInfo> |
computeTasksInfo() |
void |
ending()
Does bookkeeping at node end.
|
static boolean |
equality(Object o1,
Object o2) |
protected Date |
evaluateDueDate() |
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 taskAssigneesVar
|
List<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.
|
void |
executeChain(String chainId,
String transitionId) |
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
|
void |
executeTransitionChain(GraphNode.Transition transition)
Executes an Automation chain in the context of this node for a given transition
|
protected boolean |
getBoolean(String propertyName) |
long |
getCanceledCount()
Gets the canceled count for this node.
|
List<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 node
|
protected OperationContext |
getExecutionContext(CoreSession session) |
String |
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 node
|
protected Calendar |
getNodeEndTime() |
protected String |
getNodeLastActor() |
protected Calendar |
getNodeStartTime() |
String |
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.
|
protected CoreSession |
getSession() |
GraphNode.State |
getState()
Get the node state.
|
protected Map<String,Serializable> |
getSubRouteInitialVariables() |
protected String |
getSubRouteInstanceId() |
String |
getSubRouteModelId()
Gets the sub-route model id.
|
List<String> |
getTaskAssignees()
Gets the task assignees
|
String |
getTaskAssigneesPermission()
Gets the permission to the granted to the actors on this task on the document following the workflow
|
String |
getTaskAssigneesVar() |
List<GraphNode.Button> |
getTaskButtons()
Gets the task buttons
|
String |
getTaskDirective()
Gets the task directive
|
String |
getTaskDocType() |
Date |
getTaskDueDate()
Gets the due date
|
String |
getTaskDueDateExpr() |
String |
getTaskLayout()
Gets the task layout
|
String |
getTaskNotificationTemplate() |
List<GraphNode.TaskInfo> |
getTasksInfo()
Gets all the tasks info for the tasks created from this node
|
Map<String,Serializable> |
getVariables()
Gets a map containing the variables currently defined on this node
|
Map<String,Serializable> |
getWorkflowContextualInfo(CoreSession session,
boolean detached)
Gets a map containing the workflow and node variables and workflow documents.
|
protected String |
getWorkflowInitiator() |
protected String |
getWorkflowParentNodeId() |
protected String |
getWorkflowParentRouteId() |
protected Calendar |
getWorkflowStartTime() |
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.
|
protected void |
incrementProp(String prop) |
void |
initAddInputTransition(GraphNode.Transition transition)
Internal during graph init.
|
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) |
protected void |
saveDocument() |
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 any
|
void |
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.
|
String |
toString() |
void |
updateTaskInfo(String taskId,
boolean ended,
String status,
String actor,
String comment)
Persist these info from the task on the node.
|
protected <T> T |
valueOrExpression(Class<T> klass,
String v,
OperationContext context,
String kind) |
backToReady, cancel, canDeleteStep, canUndoStep, canUpdateStep, canValidateStep, checkLifeCycleState, followTransition, getAttachedDocuments, getDescription, getDocument, getDocumentRoute, getName, getProperty, getTitle, hasPermissionOnDocument, isCanceled, isDone, isDraft, isModifiable, isReady, isRunning, isValidated, resume, run, run, save, setCanceled, setCanDeleteStep, setCanReadStep, setCanUpdateStep, setCanValidateStep, setDone, setPermissionOnDocument, setReadOnly, setReady, setRunning, setValidated, undo, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDocumentprotected final GraphRouteImpl graph
protected GraphNode.State localState
protected List<GraphNode.Transition> inputTransitions
protected List<GraphNode.Transition> outputTransitions
protected List<GraphNode.Button> taskButtons
protected List<GraphNode.EscalationRule> escalationRules
protected List<GraphNode.TaskInfo> tasksInfo
public GraphNodeImpl(DocumentModel doc, GraphRouteImpl graph)
public GraphNodeImpl(DocumentModel doc)
protected boolean getBoolean(String propertyName)
protected void incrementProp(String prop)
protected CoreSession getSession()
protected void saveDocument()
public GraphNode.State getState()
GraphNodepublic void setState(GraphNode.State state)
GraphNodepublic boolean isStart()
GraphNodepublic boolean isStop()
GraphNodepublic void setCanceled()
GraphNodesetCanceled in interface GraphNodepublic long getCanceledCount()
GraphNodegetCanceledCount in interface GraphNodepublic boolean isMerge()
GraphNodepublic String getInputChain()
GraphNodegetInputChain in interface GraphNodepublic String getOutputChain()
GraphNodegetOutputChain in interface GraphNodepublic boolean hasTask()
GraphNodepublic List<String> getTaskAssignees()
GraphNodegetTaskAssignees in interface GraphNodepublic String getTaskAssigneesVar()
public Date getTaskDueDate()
GraphNodegetTaskDueDate in interface GraphNodepublic String getTaskDirective()
GraphNodegetTaskDirective in interface GraphNodepublic String getTaskAssigneesPermission()
GraphNodegetTaskAssigneesPermission in interface GraphNodepublic String getTaskLayout()
GraphNodegetTaskLayout in interface GraphNodepublic String getTaskNotificationTemplate()
getTaskNotificationTemplate in interface GraphNodepublic String getTaskDueDateExpr()
getTaskDueDateExpr in interface GraphNodepublic void starting()
GraphNodepublic void ending()
GraphNodepublic Map<String,Serializable> getVariables()
GraphNodegetVariables in interface GraphNodepublic Map<String,Serializable> getJsonVariables()
GraphNodegetJsonVariables in interface GraphNodepublic void setVariables(Map<String,Serializable> map)
GraphNodesetVariables in interface GraphNodemap - the map of variablespublic void setJSONVariables(Map<String,String> map)
GraphNodesetJSONVariables in interface GraphNodemap - the map of variablespublic void setAllVariables(Map<String,Object> map)
GraphNodesetAllVariables in interface GraphNodemap - the map of variablespublic void setAllVariables(Map<String,Object> map, boolean allowGlobalVariablesAssignement)
GraphNodesetAllVariables in interface GraphNodemap - the map of variablesallowGlobalVariablesAssignement - if set to false, throw a DocumentRouteException when trying to set global
variables when not supposed toprotected OperationContext getExecutionContext(CoreSession session)
public Map<String,Serializable> getWorkflowContextualInfo(CoreSession session, boolean detached)
GraphNodegetWorkflowContextualInfo in interface GraphNodedetached - The documents added into this map can be detached or notprotected String getWorkflowInitiator()
protected Calendar getWorkflowStartTime()
protected String getWorkflowParentRouteId()
protected String getWorkflowParentNodeId()
protected Calendar getNodeStartTime()
protected Calendar getNodeEndTime()
protected String getNodeLastActor()
public void executeChain(String chainId) throws DocumentRouteException
GraphNodeexecuteChain in interface GraphNodechainId - the chainDocumentRouteExceptionpublic void executeTransitionChain(GraphNode.Transition transition) throws DocumentRouteException
GraphNodeexecuteTransitionChain in interface GraphNodetransition - the transitionDocumentRouteExceptionpublic void executeChain(String chainId, String transitionId) throws DocumentRouteException
DocumentRouteExceptionpublic void initAddInputTransition(GraphNode.Transition transition)
GraphNodeinitAddInputTransition in interface GraphNodeprotected List<GraphNode.Transition> computeOutputTransitions()
public List<GraphNode.Transition> getOutputTransitions()
GraphNodegetOutputTransitions in interface GraphNodepublic List<GraphNode.Transition> evaluateTransitions() throws DocumentRouteException
GraphNodeTransitions 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
evaluateTransitions in interface GraphNodeDocumentRouteExceptionpublic List<String> evaluateTaskAssignees() throws DocumentRouteException
GraphNodeevaluateTaskAssignees in interface GraphNodeDocumentRouteExceptionpublic boolean canMerge()
GraphNodepublic List<GraphNode.Transition> getInputTransitions()
GraphNodegetInputTransitions in interface GraphNodepublic void cancelTasks()
GraphNodecancelTasks in interface GraphNodepublic List<GraphNode.Button> getTaskButtons()
GraphNodegetTaskButtons in interface GraphNodeprotected List<GraphNode.Button> computeTaskButtons()
public void setButton(String status)
GraphNodepublic void setLastActor(String actor)
GraphNodesetLastActor in interface GraphNodeactor - the user idprotected void addTaskAssignees(List<String> taskAssignees)
public String getTaskDocType()
getTaskDocType in interface GraphNodeprotected Date evaluateDueDate() throws DocumentRouteException
DocumentRouteExceptionpublic Date computeTaskDueDate() throws DocumentRouteException
GraphNodecomputeTaskDueDate in interface GraphNodeDocumentRouteExceptionpublic boolean executeOnlyFirstTransition()
GraphNodeexecuteOnlyFirstTransition in interface GraphNodepublic boolean hasSubRoute() throws DocumentRouteException
GraphNodehasSubRoute in interface GraphNodetrue if there is a sub-routeDocumentRouteExceptionpublic String getSubRouteModelId() throws DocumentRouteException
GraphNodeIf this is present, then this node will be suspended while the sub-route is run. When the sub-route ends, this node will resume.
getSubRouteModelId in interface GraphNodenull if none is definedDocumentRouteExceptionprotected String getSubRouteInstanceId()
public DocumentRoute startSubRoute() throws DocumentRouteException
GraphNodestartSubRoute in interface GraphNodeDocumentRouteExceptionprotected Map<String,Serializable> getSubRouteInitialVariables()
protected <T> T valueOrExpression(Class<T> klass, String v, OperationContext context, String kind) throws DocumentRouteException
DocumentRouteExceptionpublic void cancelSubRoute() throws DocumentRouteException
GraphNodecancelSubRoute in interface GraphNodeDocumentRouteExceptionprotected List<GraphNode.EscalationRule> computeEscalationRules()
public List<GraphNode.EscalationRule> getEscalationRules()
GraphNodegetEscalationRules in interface GraphNodepublic List<GraphNode.EscalationRule> evaluateEscalationRules()
GraphNodeevaluateEscalationRules in interface GraphNodepublic boolean hasMultipleTasks()
GraphNodehasMultipleTasks in interface GraphNodeprotected List<GraphNode.TaskInfo> computeTasksInfo()
public List<GraphNode.TaskInfo> getTasksInfo()
GraphNodegetTasksInfo in interface GraphNodepublic void addTaskInfo(String taskId)
GraphNodeaddTaskInfo in interface GraphNodepublic void removeTaskInfo(String taskId)
removeTaskInfo in interface GraphNodepublic void updateTaskInfo(String taskId, boolean ended, String status, String actor, String comment)
GraphNodeupdateTaskInfo in interface GraphNodepublic List<GraphNode.TaskInfo> getEndedTasksInfo()
GraphNodegetEndedTasksInfo in interface GraphNodepublic boolean hasOpenTasks()
GraphNodehasOpenTasks in interface GraphNodepublic List<GraphNode.TaskInfo> getProcessedTasksInfo()
GraphNodegetProcessedTasksInfo in interface GraphNodepublic boolean allowTaskReassignment()
GraphNodeallowTaskReassignment in interface GraphNodeprotected void cancelTask(CoreSession session, String taskId) throws DocumentRouteException
DocumentRouteExceptionpublic void setVariable(String name, String value)
GraphNodesetVariable in interface GraphNodepublic boolean hasTaskButton(String name)
GraphNodehasTaskButton in interface GraphNodeCopyright © 2019 Nuxeo. All rights reserved.