protected void dispatchActivityCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity boundaryEventExecution, FlowNode flowNode, CommandContext commandContext) { // Scope commandContext.getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityCancelledEvent(flowNode.getId(), flowNode.getName(), boundaryEventExecution.getId(), boundaryEventExecution.getProcessInstanceId(), boundaryEventExecution.getProcessDefinitionId(), parseActivityType(flowNode), eventSubscription)); if (flowNode instanceof SubProcess) { // The parent of the boundary event execution will be the one on which the boundary event is set ExecutionEntity parentExecutionEntity = commandContext.getExecutionEntityManager().findById(boundaryEventExecution.getParentId()); if (parentExecutionEntity != null) { dispatchActivityCancelledForChildExecution(eventSubscription, parentExecutionEntity, boundaryEventExecution, commandContext); } } }
protected void dispatchActivityCancelledForChildExecution(EventSubscriptionEntity eventSubscription, ExecutionEntity parentExecutionEntity, ExecutionEntity boundaryEventExecution, CommandContext commandContext) { List<ExecutionEntity> executionEntities = commandContext.getExecutionEntityManager().findChildExecutionsByParentExecutionId(parentExecutionEntity.getId()); for (ExecutionEntity childExecution : executionEntities) { if (!boundaryEventExecution.getId().equals(childExecution.getId()) && childExecution.getCurrentFlowElement() != null && childExecution.getCurrentFlowElement() instanceof FlowNode) { FlowNode flowNode = (FlowNode) childExecution.getCurrentFlowElement(); commandContext.getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityCancelledEvent(flowNode.getId(), flowNode.getName(), childExecution.getId(), childExecution.getProcessInstanceId(), childExecution.getProcessDefinitionId(), parseActivityType(flowNode), eventSubscription)); if (childExecution.isScope()) { dispatchActivityCancelledForChildExecution(eventSubscription, childExecution, boundaryEventExecution, commandContext); } } } }
protected void dispatchActivityCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity boundaryEventExecution, FlowNode flowNode, CommandContext commandContext) { // Scope commandContext.getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityCancelledEvent(flowNode.getId(), flowNode.getName(), boundaryEventExecution.getId(), boundaryEventExecution.getProcessInstanceId(), boundaryEventExecution.getProcessDefinitionId(), parseActivityType(flowNode), eventSubscription)); if (flowNode instanceof SubProcess) { // The parent of the boundary event execution will be the one on which the boundary event is set ExecutionEntity parentExecutionEntity = commandContext.getExecutionEntityManager().findById(boundaryEventExecution.getParentId()); if (parentExecutionEntity != null) { dispatchActivityCancelledForChildExecution(eventSubscription, parentExecutionEntity, boundaryEventExecution, commandContext); } } }
protected void dispatchActivityCancelledForChildExecution(EventSubscriptionEntity eventSubscription, ExecutionEntity parentExecutionEntity, ExecutionEntity boundaryEventExecution, CommandContext commandContext) { List<ExecutionEntity> executionEntities = commandContext.getExecutionEntityManager().findChildExecutionsByParentExecutionId(parentExecutionEntity.getId()); for (ExecutionEntity childExecution : executionEntities) { if (!boundaryEventExecution.getId().equals(childExecution.getId()) && childExecution.getCurrentFlowElement() != null && childExecution.getCurrentFlowElement() instanceof FlowNode) { FlowNode flowNode = (FlowNode) childExecution.getCurrentFlowElement(); commandContext.getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityCancelledEvent(flowNode.getId(), flowNode.getName(), childExecution.getId(), childExecution.getProcessInstanceId(), childExecution.getProcessDefinitionId(), parseActivityType(flowNode), eventSubscription)); if (childExecution.isScope()) { dispatchActivityCancelledForChildExecution(eventSubscription, childExecution, boundaryEventExecution, commandContext); } } } }