Package io.zeebe.engine.processing.bpmn
Class WorkflowInstanceStateTransitionGuard
- java.lang.Object
-
- io.zeebe.engine.processing.bpmn.WorkflowInstanceStateTransitionGuard
-
public final class WorkflowInstanceStateTransitionGuard extends Object
A check to prevent concurrent state transitions of a workflow instance.A workflow instance can be have concurrent state transitions if a user command is received (e.g. cancel workflow instance) or if an internal/external event is triggered (e.g. timer boundary event). In this case, the current workflow instance processing needs to be interrupted be avoid an inconsistent state.
-
-
Constructor Summary
Constructors Constructor Description WorkflowInstanceStateTransitionGuard(BpmnStateBehavior stateBehavior)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValidStateTransition(BpmnElementContext context)Checks if a workflow instance event can be processed based on the current state.voidregisterStateTransition(BpmnElementContext context, WorkflowInstanceIntent newState)
-
-
-
Constructor Detail
-
WorkflowInstanceStateTransitionGuard
public WorkflowInstanceStateTransitionGuard(BpmnStateBehavior stateBehavior)
-
-
Method Detail
-
isValidStateTransition
public boolean isValidStateTransition(BpmnElementContext context)
Checks if a workflow instance event can be processed based on the current state.- Returns:
trueif the transition is valid.
-
registerStateTransition
public void registerStateTransition(BpmnElementContext context, WorkflowInstanceIntent newState)
-
-