Class BpmnEventPublicationBehavior
java.lang.Object
io.camunda.zeebe.engine.processing.bpmn.behavior.BpmnEventPublicationBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionBpmnEventPublicationBehavior(ZeebeState zeebeState, KeyGenerator keyGenerator, EventTriggerBehavior eventTriggerBehavior, BpmnStateBehavior stateBehavior, Writers writers) -
Method Summary
Modifier and TypeMethodDescriptionfindErrorCatchEvent(org.agrona.DirectBuffer errorCode, BpmnElementContext context) Finds the right catch event for the given error.findEscalationCatchEvent(org.agrona.DirectBuffer escalationCode, BpmnElementContext context) Finds the right catch event for the given escalation.voidthrowErrorEvent(CatchEventAnalyzer.CatchEventTuple catchEventTuple, Map<String, Object> variables, String errorMessage) Throws an error event to the given element instance/catch event pair.booleanthrowEscalationEvent(org.agrona.DirectBuffer throwElementId, org.agrona.DirectBuffer escalationCode, BpmnElementContext context) Throws an escalation event to the given element instance/catch event pair.
-
Constructor Details
-
BpmnEventPublicationBehavior
public BpmnEventPublicationBehavior(ZeebeState zeebeState, KeyGenerator keyGenerator, EventTriggerBehavior eventTriggerBehavior, BpmnStateBehavior stateBehavior, Writers writers)
-
-
Method Details
-
throwErrorEvent
public void throwErrorEvent(CatchEventAnalyzer.CatchEventTuple catchEventTuple, Map<String, Object> variables, String errorMessage) Throws an error event to the given element instance/catch event pair. Only throws the event if the given element instance is exists and is accepting events, e.g. isn't terminating, wasn't interrupted, etc.- Parameters:
catchEventTuple- a tuple representing a catch event and its current instancevariables- the variables/payload that the event can propagate (can be empty)errorMessage- the error message that the event can propagate (can be empty)
-
findErrorCatchEvent
public Either<Failure,CatchEventAnalyzer.CatchEventTuple> findErrorCatchEvent(org.agrona.DirectBuffer errorCode, BpmnElementContext context) Finds the right catch event for the given error. This is done by going up through the scope hierarchy recursively until a matching catch event is found. If none are found, a failure is returned.The returned
CatchEventAnalyzer.CatchEventTuplecan be used to throw the event viathrowErrorEvent(CatchEventTuple, Map, String).- Parameters:
errorCode- the error code of the error eventcontext- the current element context- Returns:
- a valid
CatchEventAnalyzer.CatchEventTupleif a catch event is found, or a failure otherwise
-
findEscalationCatchEvent
public Optional<CatchEventAnalyzer.CatchEventTuple> findEscalationCatchEvent(org.agrona.DirectBuffer escalationCode, BpmnElementContext context) Finds the right catch event for the given escalation. This is done by going up through the scope hierarchy recursively until a matching catch event is found. Otherwise, it returnsOptional.empty().- Parameters:
escalationCode- the escalation code of the escalation eventcontext- the current element context- Returns:
- a valid
CatchEventAnalyzer.CatchEventTupleif a catch event is found, Otherwise, it returnsOptional.empty()
-
throwEscalationEvent
public boolean throwEscalationEvent(org.agrona.DirectBuffer throwElementId, org.agrona.DirectBuffer escalationCode, BpmnElementContext context) Throws an escalation event to the given element instance/catch event pair. Only throws the event if the given element instance is exists and is accepting events, e.g. isn't terminating, wasn't interrupted, etc.- Parameters:
throwElementId- the element id of the escalation throw eventescalationCode- the escalation code of escalationcontext- process instance-related data of the element that is executed- Returns:
- returns true if the escalation throw event can be completed, false otherwise
-