@Override public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); ServiceTask serviceTask = (ServiceTask) flowNode; processDiagramCanvas.drawServiceTask(flowNode.getId(), serviceTask.getName(), graphicInfo); } });
@Override public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); if (graphicInfo.getExpanded() != null && !graphicInfo.getExpanded()) { processDiagramCanvas.drawCollapsedSubProcess(flowNode.getId(), flowNode.getName(), graphicInfo, false); } else { processDiagramCanvas.drawExpandedSubProcess(flowNode.getId(), flowNode.getName(), graphicInfo, Transaction.class); } } });
@Override public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); if (graphicInfo.getExpanded() != null && !graphicInfo.getExpanded()) { processDiagramCanvas.drawCollapsedSubProcess(flowNode.getId(), flowNode.getName(), graphicInfo, true); } else { processDiagramCanvas.drawExpandedSubProcess(flowNode.getId(), flowNode.getName(), graphicInfo, EventSubProcess.class); } } });
@Override public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); if (graphicInfo.getExpanded() != null && !graphicInfo.getExpanded()) { processDiagramCanvas.drawCollapsedSubProcess(flowNode.getId(), flowNode.getName(), graphicInfo, false); } else { processDiagramCanvas.drawExpandedSubProcess(flowNode.getId(), flowNode.getName(), graphicInfo, SubProcess.class); } } });
protected void dispatchActivityTimeOut(JobEntity timerEntity, FlowNode flowNode, ExecutionEntity execution, CommandContext commandContext) { commandContext.getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createActivityCancelledEvent(flowNode.getId(), flowNode.getName(), execution.getId(), execution.getProcessInstanceId(), execution.getProcessDefinitionId(), parseActivityType(flowNode), timerEntity)); }
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 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)); } } }