Package com.axelor.workflow.exec
Class WorkflowWaitService
java.lang.Object
com.axelor.workflow.exec.WorkflowWaitService
- All Implemented Interfaces:
WorkflowCallerResumer,RecordWake
Resumes parked runs and branches: timer waits on the scheduler's wake (
resumeTimer(java.lang.Long)),
condition waits when their record changes (resumeConditionWaitsForRecord(com.axelor.workflow.exec.RecordRef)), message waits
on delivery, and a caller parked on a <call> when its child finishes (resumeCaller(com.axelor.meta.db.MetaWorkflowRun)). A conditional waiting -> running claim gives each run exactly one
resumer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlabel()Names this source in the orchestrator's log when it fails.moveBranch(MetaWorkflowBranch branch, WorkflowPlan target, String node, Integer targetRevision) The same move for one branch of a split; its split and join are unchanged, so the target must be on a branch of the same split.moveRun(MetaWorkflowRun run, WorkflowPlan target, String node, Integer targetRevision) Move a parked run onto a node of another revision, as an operator chose: claim it, tear down what its park held, and enter the target as a fresh arrival that derives its own park.resumeCaller(MetaWorkflowRun child) Wake a run parked on a<call>now that its child has finished.intRecord-change wake: re-enter every condition wait parked onrecord.intresumeMessageWaits(String name, String key, MessageDelivery message) Wake every park subscribed to this message.resumeTimer(Long runId) Scheduler wake for a due wake time: claim the run and re-enter the parked node, which knows whether its own timer or a boundary came due.resumeTimerToken(Long tokenId) Wake a branch whose timer is due; it walks to its join and the split decides what follows.voidRe-check whatever this source watches for one record, resuming what has become due.
-
Constructor Details
-
WorkflowWaitService
public WorkflowWaitService()
-
-
Method Details
-
label
Description copied from interface:RecordWakeNames this source in the orchestrator's log when it fails.- Specified by:
labelin interfaceRecordWake
-
wake
Description copied from interface:RecordWakeRe-check whatever this source watches for one record, resuming what has become due.- Specified by:
wakein interfaceRecordWake
-
resumeTimer
Scheduler wake for a due wake time: claim the run and re-enter the parked node, which knows whether its own timer or a boundary came due. It re-parks when neither did. -
resumeConditionWaitsForRecord
Record-change wake: re-enter every condition wait parked onrecord. Returns how many runs were re-evaluated. -
resumeCaller
Wake a run parked on a<call>now that its child has finished. The way back is thecallerParkKeythe caller wrote on the child; a failed child fails the caller. An escape branch has no caller park, so nothing is woken for it.- Specified by:
resumeCallerin interfaceWorkflowCallerResumer
-
moveRun
public WorkflowResult moveRun(MetaWorkflowRun run, WorkflowPlan target, String node, Integer targetRevision) Move a parked run onto a node of another revision, as an operator chose: claim it, tear down what its park held, and enter the target as a fresh arrival that derives its own park.- Parameters:
targetRevision- re-pinned before the walk, so the walk reads the graph it moved onto- Returns:
- skipped when the claim was lost to an approver or a due timer
-
moveBranch
public WorkflowResult moveBranch(MetaWorkflowBranch branch, WorkflowPlan target, String node, Integer targetRevision) The same move for one branch of a split; its split and join are unchanged, so the target must be on a branch of the same split. -
resumeMessageWaits
Wake every park subscribed to this message. The matching subscription says which trigger fired: its boundary, or the parked node's own when it names none. The same one-winner claim applies, so two deliveries cannot both resume one run.- Parameters:
key- the occurrence to match, or null for a signal, which matches only keyless subscriptionsmessage- what each woken walk reads asmessage- Returns:
- how many parks moved
-
resumeTimerToken
Wake a branch whose timer is due; it walks to its join and the split decides what follows.
-