Class BpmnEventSubscriptionBehavior

java.lang.Object
io.camunda.zeebe.engine.processing.bpmn.behavior.BpmnEventSubscriptionBehavior

public final class BpmnEventSubscriptionBehavior extends Object
  • Constructor Details

  • Method Details

    • subscribeToEvents

      public <T extends ExecutableCatchEventSupplier> Either<Failure,Void> subscribeToEvents(T element, BpmnElementContext context)
      Returns:
      either a failure or nothing
    • unsubscribeFromEvents

      public void unsubscribeFromEvents(BpmnElementContext context)
    • findEventTrigger

      public Optional<EventTrigger> findEventTrigger(BpmnElementContext context)
      Checks if the given element instance was triggered by an event. Should be used in combination with activateTriggeredEvent(long, long, EventTrigger, BpmnElementContext).
      Parameters:
      context - the element instance to check
      Returns:
      the event data if the element instance was triggered. Otherwise, it returns Optional.empty().
    • activateTriggeredEvent

      public void activateTriggeredEvent(long eventScopeKey, long flowScopeKey, EventTrigger eventTrigger, BpmnElementContext context)
      Activates the element that was triggered by an event and pass in the variables of the event. Should be called after findEventTrigger(BpmnElementContext). Depending on the event type we need to give different flow scope key, e. g. for EventSubProcess the container triggers/activates the EventSubProcess, while for boundary events the attached element triggers that event which is not the flow scope.
      Parameters:
      eventScopeKey - the event scope key of the triggered event, can be the same as the flow scope key depending of the type of event
      flowScopeKey - the flow scope of event element to activate, which can be different based on the event type
      eventTrigger - the event data returned by findEventTrigger(BpmnElementContext)
      context - the current processing context
    • getEventTriggerForProcessDefinition

      public Optional<EventTrigger> getEventTriggerForProcessDefinition(long processDefinitionKey)
    • activateTriggeredStartEvent

      public void activateTriggeredStartEvent(BpmnElementContext context, EventTrigger eventTrigger)