public class GraphNodeImpl extends DocumentRouteElementImpl implements GraphNode
GraphNode.Button, GraphNode.EscalationRule, GraphNode.State, GraphNode.TaskInfo, GraphNode.Transition
DocumentRouteElement.ElementLifeCycleState, DocumentRouteElement.ElementLifeCycleTransistion
MERGE_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, validate
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDocument
public GraphNodeImpl(DocumentModel doc, GraphRouteImpl graph)
public GraphNodeImpl(DocumentModel doc)
public GraphNode.State getState()
GraphNode
public void setState(GraphNode.State state)
GraphNode
public boolean isStart()
GraphNode
public boolean isStop()
GraphNode
public void setCanceled()
GraphNode
setCanceled
in interface GraphNode
public long getCanceledCount()
GraphNode
getCanceledCount
in interface GraphNode
public boolean isMerge()
GraphNode
public String getInputChain()
GraphNode
getInputChain
in interface GraphNode
public String getOutputChain()
GraphNode
getOutputChain
in interface GraphNode
public boolean hasTask()
GraphNode
public List<String> getTaskAssignees()
GraphNode
getTaskAssignees
in interface GraphNode
public String getTaskAssigneesVar()
public Date getTaskDueDate()
GraphNode
getTaskDueDate
in interface GraphNode
public String getTaskDirective()
GraphNode
getTaskDirective
in interface GraphNode
public String getTaskAssigneesPermission()
GraphNode
getTaskAssigneesPermission
in interface GraphNode
public String getTaskLayout()
GraphNode
getTaskLayout
in interface GraphNode
public String getTaskNotificationTemplate()
getTaskNotificationTemplate
in interface GraphNode
public String getTaskDueDateExpr()
getTaskDueDateExpr
in interface GraphNode
public void starting()
GraphNode
public void ending()
GraphNode
public Map<String,Serializable> getVariables()
GraphNode
getVariables
in interface GraphNode
public void setVariables(Map<String,Serializable> map)
public void setAllVariables(Map<String,Object> map)
GraphNode
setAllVariables
in interface GraphNode
map
- the map of variablespublic Map<String,Serializable> getWorkflowContextualInfo(CoreSession session, boolean detached)
GraphNode
getWorkflowContextualInfo
in interface GraphNode
detached
- The documents added into this map can be detached or notpublic void executeChain(String chainId) throws DocumentRouteException
GraphNode
executeChain
in interface GraphNode
chainId
- the chainDocumentRouteException
public void executeTransitionChain(GraphNode.Transition transition) throws DocumentRouteException
GraphNode
executeTransitionChain
in interface GraphNode
transition
- the transitionDocumentRouteException
public void executeChain(String chainId, String transitionId) throws DocumentRouteException
DocumentRouteException
public void initAddInputTransition(GraphNode.Transition transition)
GraphNode
initAddInputTransition
in interface GraphNode
public List<GraphNode.Transition> getOutputTransitions()
GraphNode
getOutputTransitions
in interface GraphNode
public List<GraphNode.Transition> evaluateTransitions() throws DocumentRouteException
GraphNode
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
evaluateTransitions
in interface GraphNode
DocumentRouteException
public List<String> evaluateTaskAssignees() throws DocumentRouteException
GraphNode
evaluateTaskAssignees
in interface GraphNode
DocumentRouteException
public boolean canMerge()
GraphNode
public List<GraphNode.Transition> getInputTransitions()
GraphNode
getInputTransitions
in interface GraphNode
public void cancelTasks()
GraphNode
cancelTasks
in interface GraphNode
public List<GraphNode.Button> getTaskButtons()
GraphNode
getTaskButtons
in interface GraphNode
public void setButton(String status)
GraphNode
public void setLastActor(String actor)
GraphNode
setLastActor
in interface GraphNode
actor
- the user idpublic String getTaskDocType()
getTaskDocType
in interface GraphNode
public Date computeTaskDueDate() throws DocumentRouteException
GraphNode
computeTaskDueDate
in interface GraphNode
DocumentRouteException
public boolean executeOnlyFirstTransition()
GraphNode
executeOnlyFirstTransition
in interface GraphNode
public boolean hasSubRoute() throws DocumentRouteException
GraphNode
hasSubRoute
in interface GraphNode
true
if there is a sub-routeDocumentRouteException
public String getSubRouteModelId() throws DocumentRouteException
GraphNode
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.
getSubRouteModelId
in interface GraphNode
null
if none is definedDocumentRouteException
public DocumentRoute startSubRoute() throws DocumentRouteException
GraphNode
startSubRoute
in interface GraphNode
DocumentRouteException
public void cancelSubRoute() throws DocumentRouteException
GraphNode
cancelSubRoute
in interface GraphNode
DocumentRouteException
public List<GraphNode.EscalationRule> getEscalationRules()
GraphNode
getEscalationRules
in interface GraphNode
public List<GraphNode.EscalationRule> evaluateEscalationRules()
GraphNode
evaluateEscalationRules
in interface GraphNode
public boolean hasMultipleTasks()
GraphNode
hasMultipleTasks
in interface GraphNode
public List<GraphNode.TaskInfo> getTasksInfo()
GraphNode
getTasksInfo
in interface GraphNode
public void addTaskInfo(String taskId) throws ClientException
GraphNode
addTaskInfo
in interface GraphNode
ClientException
public void updateTaskInfo(String taskId, boolean ended, String status, String actor, String comment) throws ClientException
GraphNode
updateTaskInfo
in interface GraphNode
ClientException
public List<GraphNode.TaskInfo> getEndedTasksInfo()
GraphNode
getEndedTasksInfo
in interface GraphNode
public boolean hasOpenTasks()
GraphNode
hasOpenTasks
in interface GraphNode
public List<GraphNode.TaskInfo> getProcessedTasksInfo()
GraphNode
getProcessedTasksInfo
in interface GraphNode
public boolean allowTaskReassignment()
GraphNode
allowTaskReassignment
in interface GraphNode
public void setVariable(String name, String value)
GraphNode
setVariable
in interface GraphNode
Copyright © 2013 Nuxeo SA. All Rights Reserved.