Class WorkflowJoinService

java.lang.Object
com.axelor.workflow.split.WorkflowJoinService

public class WorkflowJoinService extends Object
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 Details

    • WorkflowJoinService

      public WorkflowJoinService()
  • Method Details

    • settle

      public void settle(MetaWorkflowBranch branch, boolean arrivedAtBarrier)
      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

      public void failBranch(MetaWorkflowBranch branch, String message)
      A branch failed: its split fails with it, and so does the run.
    • cleanupAndRelease

      public void cleanupAndRelease(Long splitId)
      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

      public void claimAndJoin(Long splitId)
      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

      public int recoverAndJoin(Duration leaseTimeout)
      Hand back joins whose holder went away and run whatever is ready. Called by the scheduler on every node.
    • settleAfterResume

      public void settleAfterResume(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.