How Identify if Service Task is fired due to Boundary Event


I am capturing start and stop event for serviceTask and userTask on camunda-engine.

have added following property to capture events.

execution: true

I am then streaming those events for further processing.

executionDelegate.getBpmnModelElementInstance() instanceof ServiceTask

Whenever a boundary error event is attached to a ServiceTask then two Events for type ServiceTask are fired with the same value in ActivityInstanceId field


Is there a way to Identify if a ServiceTask is caused by BoundaryEvent from executionDelegate variable

public void onExecutionEvent(DelegateExecution executionDelegate) {
//code to send