Class RunCancellation

java.lang.Object
com.axelor.workflow.exec.RunCancellation

public class RunCancellation extends Object
Takes back what a run, a region or a set of branches still has in flight: approvals, parks, the runs it called, and the run itself when it is over. Nothing answerable is left behind.
  • Constructor Details

    • RunCancellation

      public RunCancellation()
  • Method Details

    • abandonRun

      public void abandonRun(Long runId, String reason)
      Give up a run for good, finishing it as cancelled; terminateRun(java.lang.Long, java.lang.String) is the same teardown ending as a completion cut short.
    • cancelRunTree

      public int cancelRunTree(Long runId, String reason)
      Give up a run and everything it called, however deep. The root goes first, so a child cancelled afterwards cannot resume a caller that is being torn down.
    • cancelChildOf

      public int cancelChildOf(String parkKey, String reason)
      The child a branch was parked on at a call, taken down with the branch; its approvals belong to the child.
    • cancelCalledRuns

      public int cancelCalledRuns(Long runId, String callNodeId, String reason)
      End the child run of one call whose cancelling boundary fired, and everything it called, leaving the host's other children, such as escape branches, alone.
    • cancelDescendants

      public int cancelDescendants(Long runId, String reason)
      Everything below a run, for the endings that finish the root themselves.
    • cancelRun

      public void cancelRun(Long runId)
      Give up whatever this run still has in flight: every live split, its owed branches and their approvals. How the run itself ends is the caller's to decide. Idempotent.
    • terminateRun

      public boolean terminateRun(Long runId, String atNode)
      A terminate end was reached: everything else in flight stops, and the run finishes as terminated.
    • cancelBranches

      public void cancelBranches(List<MetaWorkflowBranch> branches, String reason)
      Take down a set of live branches and what they hold: a nested split, a call they wait on, and their open approvals. Shared by a sealed quorum and an interrupted region.
    • cancelRegion

      public void cancelRegion(MetaWorkflowSplit split, String reason, String viaBoundary)
      A boundary interrupted a whole <subflow>: every thread in the region stops, its park closes, and the activation is cancelled. The run itself carries on from the boundary, which the subflow's visit records as its way out.
    • cancelLiveBranches

      public void cancelLiveBranches(List<MetaWorkflowBranch> branches)
      Take back the approvals of branches still waiting, so a failed run leaves nothing clickable.
    • withdraw

      public void withdraw(MetaWorkflowTask task)
      Take back one approval nobody can act on any more, and tell its inbox to refresh.
    • discardParks

      public void discardParks(List<String> parkKeys)
      Take back the parks a split's branches opened during a walk that then did not need them: a sealed quorum, a sibling's terminate, a failure. Called in the transaction that opened them, so withdrawing the approvals leaves the inbox as it was. A branch parked at a call started a child run that commits regardless, so that child is cancelled.