protected void executeMultiInstanceSynchronous(FlowNode flowNode) { // Execution listener: event 'start' if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START); } // Execute any boundary events, sub process boundary events will be executed from the activity behavior if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents(); if (CollectionUtil.isNotEmpty(boundaryEvents)) { executeBoundaryEvents(boundaryEvents, execution); } } // Execute the multi instance behavior ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior(); if (activityBehavior != null) { executeActivityBehavior(activityBehavior, flowNode); } else { throw new ActivitiException("Expected an activity behavior in flow node " + flowNode.getId()); } }
protected void executeSynchronous(FlowNode flowNode) { commandContext.getHistoryManager().recordActivityStart(execution); // Execution listener: event 'start' if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START); } // Execute any boundary events, sub process boundary events will be executed from the activity behavior if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents(); if (CollectionUtil.isNotEmpty(boundaryEvents)) { executeBoundaryEvents(boundaryEvents, execution); } } // Execute actual behavior ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior(); if (activityBehavior != null) { executeActivityBehavior(activityBehavior, flowNode); } else { logger.debug("No activityBehavior on activity '{}' with execution {}", flowNode.getId(), execution.getId()); Context.getAgenda().planTakeOutgoingSequenceFlowsOperation(execution, true); } }
protected void executeSynchronous(FlowNode flowNode) { if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START);
protected void handleActivityEnd(FlowNode flowNode) { // a process instance execution can never leave a flow node, but it can pass here whilst cleaning up // hence the check for NOT being a process instance if (!execution.isProcessInstanceType()) { if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_END); } commandContext.getHistoryManager().recordActivityEnd(execution, null); if (!(execution.getCurrentFlowElement() instanceof SubProcess)) { Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityEvent(ActivitiEventType.ACTIVITY_COMPLETED, flowNode.getId(), flowNode.getName(), execution.getId(), execution.getProcessInstanceId(), execution.getProcessDefinitionId(), flowNode)); } } }
@Override public void parse(BpmnParse bpmnParse, BaseElement element) { super.parse(bpmnParse, element); createExecutionListenersOnScope(bpmnParse, ((FlowNode) element).getExecutionListeners(), findActivity(bpmnParse, element.getId())); }
protected void executeMultiInstanceSynchronous(FlowNode flowNode) { // Execution listener: event 'start' if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START); } // Execute any boundary events, sub process boundary events will be executed from the activity behavior if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents(); if (CollectionUtil.isNotEmpty(boundaryEvents)) { executeBoundaryEvents(boundaryEvents, execution); } } // Execute the multi instance behavior ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior(); if (activityBehavior != null) { executeActivityBehavior(activityBehavior, flowNode); } else { throw new ActivitiException("Expected an activity behavior in flow node " + flowNode.getId()); } }
protected void executeSynchronous(FlowNode flowNode) { commandContext.getHistoryManager().recordActivityStart(execution); // Execution listener: event 'start' if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START); } // Execute any boundary events, sub process boundary events will be executed from the activity behavior if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents(); if (CollectionUtil.isNotEmpty(boundaryEvents)) { executeBoundaryEvents(boundaryEvents, execution); } } // Execute actual behavior ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior(); if (activityBehavior != null) { executeActivityBehavior(activityBehavior, flowNode); } else { logger.debug("No activityBehavior on activity '{}' with execution {}", flowNode.getId(), execution.getId()); Context.getAgenda().planTakeOutgoingSequenceFlowsOperation(execution, true); } }
protected void executeSynchronous(FlowNode flowNode) { if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START);
protected void handleActivityEnd(FlowNode flowNode) { // a process instance execution can never leave a flow node, but it can pass here whilst cleaning up // hence the check for NOT being a process instance if (!execution.isProcessInstanceType()) { if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) { executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_END); } commandContext.getHistoryManager().recordActivityEnd(execution, null); if (!(execution.getCurrentFlowElement() instanceof SubProcess)) { Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityEvent(ActivitiEventType.ACTIVITY_COMPLETED, flowNode.getId(), flowNode.getName(), execution.getId(), execution.getProcessInstanceId(), execution.getProcessDefinitionId(), flowNode)); } } }