public class GraphNodeImpl extends DocumentRouteElementImpl implements GraphNode
GraphNode.Button, GraphNode.EscalationRule, GraphNode.State, GraphNode.TaskInfo, GraphNode.TransitionDocumentRouteElement.ElementLifeCycleState, DocumentRouteElement.ElementLifeCycleTransistionMERGE_ALL, MERGE_ONE, NODE_VARIABLE_COMMENT, PROP_ALLOW_TASK_REASSIGNMENT, PROP_BTN_FILTER, PROP_BTN_LABEL, PROP_BTN_NAME, 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_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_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 |
|---|---|
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.
|
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
dueDate
|
void |
ending()
Does bookkeeping at node end.
|
static boolean |
equality(Object o1,
Object o2) |
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
|
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
|
String |
getId()
Get the node id.
|
String |
getInputChain()
Get input chain.
|
List<GraphNode.Transition> |
getInputTransitions()
Gets the input transitions.
|
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.
|
GraphNode.State |
getState()
Get the node state.
|
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.
|
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.
|
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 |
setAllVariables(Map<String,Object> map)
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 |
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) |
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.
|
backToReady, cancel, canDeleteStep, canUndoStep, canUpdateStep, canValidateStep, followTransition, getAttachedDocuments, getDescription, getDocument, getDocumentRoute, getName, isCanceled, isDone, isDraft, isModifiable, isReady, isRunning, isValidated, resume, run, run, save, setCanceled, setCanDeleteStep, setCanReadStep, setCanUpdateStep, setCanValidateStep, setDone, setReadOnly, setReady, setRunning, setValidated, undo, validateequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDocumentpublic GraphNodeImpl(DocumentModel doc, GraphRouteImpl graph)
public GraphNodeImpl(DocumentModel doc)
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 void setVariables(Map<String,Serializable> map)
public void setAllVariables(Map<String,Object> map)
GraphNodesetAllVariables in interface GraphNodemap - the map of variablespublic Map<String,Serializable> getWorkflowContextualInfo(CoreSession session, boolean detached)
GraphNodegetWorkflowContextualInfo in interface GraphNodedetached - The documents added into this map can be detached or notpublic 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 GraphNodepublic 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 GraphNodepublic void setButton(String status)
GraphNodepublic void setLastActor(String actor)
GraphNodesetLastActor in interface GraphNodeactor - the user idpublic String getTaskDocType()
getTaskDocType in interface GraphNodepublic 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 definedDocumentRouteExceptionpublic DocumentRoute startSubRoute() throws DocumentRouteException
GraphNodestartSubRoute in interface GraphNodeDocumentRouteExceptionpublic void cancelSubRoute()
throws DocumentRouteException
GraphNodecancelSubRoute in interface GraphNodeDocumentRouteExceptionpublic List<GraphNode.EscalationRule> getEscalationRules()
GraphNodegetEscalationRules in interface GraphNodepublic List<GraphNode.EscalationRule> evaluateEscalationRules()
GraphNodeevaluateEscalationRules in interface GraphNodepublic boolean hasMultipleTasks()
GraphNodehasMultipleTasks in interface GraphNodepublic List<GraphNode.TaskInfo> getTasksInfo()
GraphNodegetTasksInfo in interface GraphNodepublic void addTaskInfo(String taskId) throws ClientException
GraphNodeaddTaskInfo in interface GraphNodeClientExceptionpublic void updateTaskInfo(String taskId, boolean ended, String status, String actor, String comment) throws ClientException
GraphNodeupdateTaskInfo in interface GraphNodeClientExceptionpublic 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 GraphNodepublic void setVariable(String name, String value)
GraphNodesetVariable in interface GraphNodeCopyright © 2013 Nuxeo SA. All Rights Reserved.