Interface BpmnElementProcessor<T extends ExecutableFlowElement>

Type Parameters:
T - the type that represents the BPMN element
All Known Subinterfaces:
BpmnElementContainerProcessor<T>
All Known Implementing Classes:
BoundaryEventProcessor, BusinessRuleTaskProcessor, CallActivityProcessor, EndEventProcessor, EventBasedGatewayProcessor, EventSubProcessProcessor, ExclusiveGatewayProcessor, InclusiveGatewayProcessor, IntermediateCatchEventProcessor, IntermediateThrowEventProcessor, JobWorkerTaskProcessor, JobWorkerTaskSupportingProcessor, ManualTaskProcessor, MultiInstanceBodyProcessor, ParallelGatewayProcessor, ProcessProcessor, ReceiveTaskProcessor, ScriptTaskProcessor, StartEventProcessor, SubProcessProcessor, UndefinedTaskProcessor, UserTaskProcessor

public interface BpmnElementProcessor<T extends ExecutableFlowElement>
The business logic of a BPMN element.

The execution of an element is divided into multiple steps that represents the lifecycle of the element. Each step defines a set of actions that can be performed in this step. The transition to the next step must be triggered explicitly in the current step.

  • Field Details

  • Method Details

    • getType

      Class<T> getType()
      Returns:
      the class that represents the BPMN element
    • onActivate

      default Either<Failure,?> onActivate(T element, BpmnElementContext context)
      The element is about to be entered. Perform every action to initialize and activate the element.

      This method returns an Eitherinvalid input: '<'Failure, ?> type, indicating the outcome of the activation attempt. A right value indicates success, while a left value (Failure) indicates that an error occurred during activation.

      If the element is a wait-state (i.e. it is waiting for an event or an external trigger) then it is waiting after this step to continue. Otherwise, it continues directly to the next step.

      Possible actions:

      • apply input mappings
      • open event subscriptions
      • initialize child elements - if the element is a container (e.g. a sub-process)
      Next step:
      • activating - the element is initialized
      • activated - if no incidents raised
      • complete - if no incidents raised invalid input: '&' not a wait-state.
      Parameters:
      element - the instance of the BPMN element that is executed
      context - process instance-related data of the element that is executed
      Returns:
      Eitherinvalid input: '<'Failure, ?> indicating the outcome of the activation attempt
    • finalizeActivation

      default Either<Failure,?> finalizeActivation(T element, BpmnElementContext context)
      Finalizes the activation of the BPMN element. This method is invoked after the element has been initialized and activated, ensuring that any additional steps required to fully establish the element's active state are completed.

      This method is typically invoked after the processing of START Execution Listeners.

      Parameters:
      element - the instance of the BPMN element that is executed
      context - process instance-related data of the element that is executed
      Returns:
      Eitherinvalid input: '<'Failure, ?> indicating the outcome of the finalize activation attempt
    • onComplete

      default Either<Failure,?> onComplete(T element, BpmnElementContext context)
      The element is going to be left. Perform every action to leave the element and continue with the next element.

      This method returns an Eitherinvalid input: '<'Failure, ?> type, indicating the outcome of the completion attempt. A right value indicates success, while a left value (Failure) indicates that an error occurred during the element's completion.

      Possible actions:

      • apply output mappings
      • close event subscriptions
      • take outgoing sequence flows - if any
      • continue with parent element - if no outgoing sequence flows
      • clean up the state
      Next step: none.
      Parameters:
      element - the instance of the BPMN element that is executed
      context - process instance-related data of the element that is executed
      Returns:
      Eitherinvalid input: '<'Failure, ?> indicating the outcome of the completion attempt
    • finalizeCompletion

      default Either<Failure,?> finalizeCompletion(T element, BpmnElementContext context)
      Finalizes the completion of the BPMN element. This method is called when the element has finished executing its main behavior and is ready to transition to a completed state.

      This method is typically invoked after the processing of END Execution Listeners.

      Parameters:
      element - the instance of the BPMN element that is executed
      context - process instance-related data of the element that is executed
      Returns:
      Eitherinvalid input: '<'Failure, ?> indicating the outcome of the finalize completion attempt
    • onTerminate

      default void onTerminate(T element, BpmnElementContext context)
      The element is going to be terminated. Perform every action to terminate the element and continue with the element that caused the termination (e.g. the triggered boundary event).

      Possible actions:

      • close event subscriptions
      • resolve incidents
      • activate the triggered boundary event - if any
      • activate the triggered event sub-process - if any
      • continue with parent element
      • clean up the state
      Next step: none.
      Parameters:
      element - the instance of the BPMN element that is executed
      context - process instance-related data of the element that is executed