Package com.axelor.workflow.split
Class WorkflowSplitService
java.lang.Object
com.axelor.workflow.split.WorkflowSplitService
Writes down where a split's branches got to once one of them has to wait. A split that finishes
in one pass writes nothing; once a branch parks, every branch of the activation gets a row so the
join can count them.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhere one branch got to when the walk stopped for the split.static final recordA split one branch ran into, carried up the stack until that branch has a row for it to hang from, then written right after its parent.static final recordThe park watching a whole region, resolved as the walk entered it:enteredAtis the entry, which is what its deadlines run from. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbranchesOf(MetaWorkflowSplit split) The branches of this activation, whatever state they are in.voidcloseRegionPark(MetaWorkflowSplit split) Close a region's park on every way out, so no deadline stays due for a region already left.voidfinishBranches(List<MetaWorkflowBranch> branches, WorkflowBranchStatus status) Move every branch that did not fail or get cancelled tostatus.materialize(Long runId, String splitNode, String joinNode, Integer threshold, int selected, MetaWorkflowBranch parentToken, List<WorkflowSplitService.BranchOutcome> outcomes) Record one activation of a split and a branch row for each of its branches.materialize(Long runId, String splitNode, String joinNode, String nodePath, Integer threshold, int selected, MetaWorkflowBranch parentToken, List<WorkflowSplitService.BranchOutcome> outcomes, WorkflowSplitService.RegionPark regionPark) The same for a subflow's region:nodePathis the subflow node whose body the branches walk; null for a split.openRegionOf(Long runId, String nodeId) The open activation of one subflow node in one run, or null.parkKeysOf(List<WorkflowSplitService.BranchOutcome> outcomes) Every park key under these outcomes, however deeply nested.voidrepark(MetaWorkflowBranch branch, String currentNode, String parkKey, LocalDateTime wakeAt, boolean blocked, String vars, String bindings) A branch resumed and stopped again before its join: move its row to where the walk got to, still owed.
-
Constructor Details
-
WorkflowSplitService
public WorkflowSplitService()
-
-
Method Details
-
materialize
public MetaWorkflowSplit materialize(Long runId, String splitNode, String joinNode, Integer threshold, int selected, MetaWorkflowBranch parentToken, List<WorkflowSplitService.BranchOutcome> outcomes) Record one activation of a split and a branch row for each of its branches.- Parameters:
threshold- the arrivals its join waits for, or null for allselected- how many flows the split activated, stored because losers' rows no longer sayparentToken- the branch this split sits inside, when nested; null at the top level- Returns:
- the activation, with its branches saved
-
materialize
public MetaWorkflowSplit materialize(Long runId, String splitNode, String joinNode, String nodePath, Integer threshold, int selected, MetaWorkflowBranch parentToken, List<WorkflowSplitService.BranchOutcome> outcomes, WorkflowSplitService.RegionPark regionPark) The same for a subflow's region:nodePathis the subflow node whose body the branches walk; null for a split. -
closeRegionPark
Close a region's park on every way out, so no deadline stays due for a region already left. -
repark
public void repark(MetaWorkflowBranch branch, String currentNode, String parkKey, LocalDateTime wakeAt, boolean blocked, String vars, String bindings) A branch resumed and stopped again before its join: move its row to where the walk got to, still owed.- Parameters:
blocked- whether it stopped on a split of its own rather than a person or a timervars- a region branch's own frame as JSON to carry across the park; null keeps the row'sbindings- what the walk read asagent,taskanderror, as JSON
-
parkKeysOf
Every park key under these outcomes, however deeply nested. -
openRegionOf
The open activation of one subflow node in one run, or null. -
finishBranches
Move every branch that did not fail or get cancelled tostatus. When the activation fails or is cancelled, a branch that already finished keeps that, so it is not shown failing or losing work it did. -
branchesOf
The branches of this activation, whatever state they are in.
-