Class BpmnEventSubscriptionBehavior
- java.lang.Object
-
- io.camunda.zeebe.engine.processing.bpmn.behavior.BpmnEventSubscriptionBehavior
-
public final class BpmnEventSubscriptionBehavior extends Object
-
-
Constructor Summary
Constructors Constructor Description BpmnEventSubscriptionBehavior(CatchEventBehavior catchEventBehavior, EventTriggerBehavior eventTriggerBehavior, TypedCommandWriter commandWriter, SideEffects sideEffects, ZeebeState zeebeState, KeyGenerator keyGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
activateTriggeredStartEvent(BpmnElementContext context, EventTrigger eventTrigger)
Optional<EventTrigger>
findEventTrigger(BpmnElementContext context)
Checks if the given element instance was triggered by an event.Optional<EventTrigger>
getEventTriggerForProcessDefinition(long processDefinitionKey)
<T extends ExecutableCatchEventSupplier>
Either<Failure,Void>subscribeToEvents(T element, BpmnElementContext context)
void
unsubscribeFromEvents(BpmnElementContext context)
-
-
-
Constructor Detail
-
BpmnEventSubscriptionBehavior
public BpmnEventSubscriptionBehavior(CatchEventBehavior catchEventBehavior, EventTriggerBehavior eventTriggerBehavior, TypedCommandWriter commandWriter, SideEffects sideEffects, ZeebeState zeebeState, KeyGenerator keyGenerator)
-
-
Method Detail
-
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 withactivateTriggeredEvent(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 afterfindEventTrigger(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 eventflowScopeKey
- the flow scope of event element to activate, which can be different based on the event typeeventTrigger
- the event data returned byfindEventTrigger(BpmnElementContext)
context
- the current processing context
-
getEventTriggerForProcessDefinition
public Optional<EventTrigger> getEventTriggerForProcessDefinition(long processDefinitionKey)
-
activateTriggeredStartEvent
public void activateTriggeredStartEvent(BpmnElementContext context, EventTrigger eventTrigger)
-
-