Package com.axelor.workflow.split
Class WorkflowJoinService
java.lang.Object
com.axelor.workflow.split.WorkflowJoinService
What happens when a branch of a split finishes: the counting, the cleanup of losing branches, and
the one continuation past the join. Counters move under the split row's lock and the join is a
conditional claim, so two branches finishing at once can neither both continue nor both stop.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclaimAndJoin(Long splitId) Claim one ready split's join and run it.voidcleanupAndRelease(Long splitId) The cleanup transaction: take back what the losing branches hold, then release the join.voidfailBranch(MetaWorkflowBranch branch, String message) A branch failed: its split fails with it, and so does the run.intrecoverAndJoin(Duration leaseTimeout) Hand back joins whose holder went away and run whatever is ready.voidsettle(MetaWorkflowBranch branch, boolean arrivedAtBarrier) Settle one branch and, if that decides the activation, release the join once.voidsettleAfterResume(MetaWorkflowBranch branch, WorkflowResult result) What a resumed branch's result means for the branch, whether an approval, a timer or an inner join woke it.
-
Constructor Details
-
WorkflowJoinService
public WorkflowJoinService()
-
-
Method Details
-
settle
Settle one branch and, if that decides the activation, release the join once. This is the report transaction: the branch's transition, the counters and the decision, all under the split row's lock. Cleanup and continuation get transactions of their own.- Parameters:
arrivedAtBarrier- whether the branch reached the join, or ended before it
-
failBranch
A branch failed: its split fails with it, and so does the run. -
cleanupAndRelease
The cleanup transaction: take back what the losing branches hold, then release the join. Kept short and apart from the continuation, since a loser completing its approval meanwhile waits on the split row. Claimed by lease, so a split left cancelling by a dead node is taken over. -
claimAndJoin
Claim one ready split's join and run it. The claim is a leased conditional update: one node wins, and a lease that expires hands the join back. -
recoverAndJoin
Hand back joins whose holder went away and run whatever is ready. Called by the scheduler on every node. -
settleAfterResume
What a resumed branch's result means for the branch, whether an approval, a timer or an inner join woke it.
-