ensureNotNull("Could not find cancel boundary event for cancel end event " + execution.getActivity(), "cancelBoundaryEvent", cancelBoundaryEvent);
ActivityExecution scopeExecution = ScopeUtil.findScopeExecutionForScope((ExecutionEntity) execution, cancelBoundaryEvent.getParentActivity());
// end all executions and process instances in the scope of the transaction
scopeExecution.cancelScope("cancel end event fired");
scopeExecution.interruptScope("cancel end event fired");
// the scope execution executes the boundary event
ActivityExecution outgoingExecution = scopeExecution;
outgoingExecution.setActivity(cancelBoundaryEvent);