Package com.axelor.workflow.exec
Class WorkflowExecutor
java.lang.Object
com.axelor.workflow.exec.WorkflowExecutor
Walks a workflow's graph for one record. It does not evaluate triggers, apply repeat policy or
record the run; those belong to the dispatch and the runner.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat a body's walk left: where it got to, and the frame it opened. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluateCondition(WorkflowPlan plan, RecordRef record, String nodeId, String expr) Evaluate one node's condition against the record in a walk's scope, without walking; used to re-check a task'swhenbefore an approval is accepted.static voidMergewritteninto the run's variables, asstoreVars(java.lang.Long, com.axelor.workflow.exec.WorkflowResult, java.util.Map<java.lang.String, java.lang.Object>)does; also used by the join.rearmDeadlines(WorkflowPlan plan, String model, String jsonModel, Long recordId, String nodeId, List<WorkflowPlan.Boundary> boundaries, String parkKey, Map<String, LocalDateTime> armed) Re-read a park'suntildeadlines from the record, for an approval or a call, which a record change cannot re-enter.renderText(WorkflowPlan plan, RecordRef record, String nodeId, String text) Render one node's prose against the record, as a task's<blocked>message.resume(WorkflowPlan plan, RecordRef record, String fromNodeId, Map<String, Object> taskBinding, Long runId, MetaWorkflowBranch token, MessageDelivery delivery) Resume one branch of a split, which stops at the branch's join rather than running to an end.resume(WorkflowPlan plan, RecordRef record, String fromNodeId, Map<String, Object> taskBinding, Long runId, MessageDelivery delivery) Resume a parked run fromfromNodeId: the record is reloaded, the closed task is bound astask, and the run's variables are read back from its row.resumeCaught(WorkflowPlan plan, RecordRef record, String fromNodeId, Long runId, MetaWorkflowBranch token, String message, String code) Continue at the boundary that caught a failure after a park, with the failure bound aserroras it is when the boundary catches it on the spot.resumeFromJoin(WorkflowPlan plan, RecordRef record, String joinNode, Long runId, MetaWorkflowBranch token) Go on from a join its branches released.run(WorkflowPlan plan, RecordRef record) Run with no triggering event.run(WorkflowPlan plan, RecordRef record, WorkflowEvent event) walkBody(WorkflowPlan body, String nodePath, RecordRef record, WorkflowRunContext caller) Walk an embedded body as one thread of a subflow's region, inside the run already walking.
-
Constructor Details
-
WorkflowExecutor
public WorkflowExecutor()
-
-
Method Details
-
run
Run with no triggering event. -
run
- Parameters:
record- the record to walkevent- the triggering snapshot, read asevent.self/event.old; null for a timer or programmatic run
-
resume
public WorkflowResult resume(WorkflowPlan plan, RecordRef record, String fromNodeId, Map<String, Object> taskBinding, Long runId, MessageDelivery delivery) Resume a parked run fromfromNodeId: the record is reloaded, the closed task is bound astask, and the run's variables are read back from its row. -
resume
public WorkflowResult resume(WorkflowPlan plan, RecordRef record, String fromNodeId, Map<String, Object> taskBinding, Long runId, MetaWorkflowBranch token, MessageDelivery delivery) Resume one branch of a split, which stops at the branch's join rather than running to an end.- Parameters:
token- the branch being continued, or null for a run's own resumedelivery- the message that woke this walk, or null; it lives for this walk only
-
resumeFromJoin
public WorkflowResult resumeFromJoin(WorkflowPlan plan, RecordRef record, String joinNode, Long runId, MetaWorkflowBranch token) Go on from a join its branches released. Nothing is restored asagent,taskorerror: no single branch's answer is the one to read after it. -
resumeCaught
public WorkflowResult resumeCaught(WorkflowPlan plan, RecordRef record, String fromNodeId, Long runId, MetaWorkflowBranch token, String message, String code) Continue at the boundary that caught a failure after a park, with the failure bound aserroras it is when the boundary catches it on the spot. -
walkBody
public WorkflowExecutor.BodyWalk walkBody(WorkflowPlan body, String nodePath, RecordRef record, WorkflowRunContext caller) Walk an embedded body as one thread of a subflow's region, inside the run already walking. It has its own context (selfis the element,parentthe caller, its own variable frame) but the caller's run, so its parks and approvals belong to the run. Walked with the split depth raised, so a park belongs to the branch written for it. -
mergeRunVars
Mergewritteninto the run's variables, asstoreVars(java.lang.Long, com.axelor.workflow.exec.WorkflowResult, java.util.Map<java.lang.String, java.lang.Object>)does; also used by the join. -
evaluateCondition
Evaluate one node's condition against the record in a walk's scope, without walking; used to re-check a task'swhenbefore an approval is accepted. -
rearmDeadlines
public Map<String,LocalDateTime> rearmDeadlines(WorkflowPlan plan, String model, String jsonModel, Long recordId, String nodeId, List<WorkflowPlan.Boundary> boundaries, String parkKey, Map<String, LocalDateTime> armed) Re-read a park'suntildeadlines from the record, for an approval or a call, which a record change cannot re-enter. One context for all of the park's boundaries.- Returns:
- the deadlines as they now stand, equal to
armedwhen nothing moved or the record has gone
-
renderText
Render one node's prose against the record, as a task's<blocked>message. Returns the text unrendered when the record has gone; a bad placeholder throws.
-