Class BpmnEventSubscriptionBehavior
java.lang.Object
io.camunda.zeebe.engine.processing.bpmn.behavior.BpmnEventSubscriptionBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionBpmnEventSubscriptionBehavior
(CatchEventBehavior catchEventBehavior, EventTriggerBehavior eventTriggerBehavior, ProcessingState processingState) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) findEventTrigger
(BpmnElementContext context) Checks if the given element instance was triggered by an event.getEventTriggerForProcessDefinition
(long processDefinitionKey) <T extends ExecutableCatchEventSupplier>
Either<Failure,Void> subscribeToEvents
(T element, BpmnElementContext context) void
unsubscribeFromEvents
(BpmnElementContext context)
-
Constructor Details
-
BpmnEventSubscriptionBehavior
public BpmnEventSubscriptionBehavior(CatchEventBehavior catchEventBehavior, EventTriggerBehavior eventTriggerBehavior, ProcessingState processingState)
-
-
Method Details
-
subscribeToEvents
public <T extends ExecutableCatchEventSupplier> Either<Failure,Void> subscribeToEvents(T element, BpmnElementContext context) - Returns:
- either a failure or nothing
-
unsubscribeFromEvents
-
findEventTrigger
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
-
activateTriggeredStartEvent
-