Class 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 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:
        true if the transition is valid.