@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { BoundaryEvent boundaryEvent = (BoundaryEvent) element; if (boundaryEvent.getAttachedToRef() != null) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_ATTACHEDTOREF, boundaryEvent.getAttachedToRef().getId(), xtw); } if (boundaryEvent.getEventDefinitions().size() == 1) { EventDefinition eventDef = boundaryEvent.getEventDefinitions().get(0); if (eventDef instanceof ErrorEventDefinition == false) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_CANCELACTIVITY, String.valueOf(boundaryEvent.isCancelActivity()).toLowerCase(), xtw); } } }
protected void handleBoundaryEvents() { for (BoundaryEvent boundaryEvent : boundaryEvents) { mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize); geometry.setOffset(new mxPoint(-(eventSize / 2), -(eventSize / 2))); geometry.setRelative(true); mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter"); boundaryPort.setId("boundary-event-" + boundaryEvent.getId()); boundaryPort.setVertex(true); Object portParent = null; if (boundaryEvent.getAttachedToRefId() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId()); } else if (boundaryEvent.getAttachedToRef() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId()); } else { throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef"); } graph.addCell(boundaryPort, portParent); generatedVertices.put(boundaryEvent.getId(), boundaryPort); } }
protected void executeParse(BpmnParse bpmnParse, BoundaryEvent boundaryEvent) { if (boundaryEvent.getAttachedToRef() == null) { logger.warn("Invalid reference in boundary event. Make sure that the referenced activity " + "is defined in the same scope as the boundary event " + boundaryEvent.getId()); return; } EventDefinition eventDefinition = null; if (boundaryEvent.getEventDefinitions().size() > 0) { eventDefinition = boundaryEvent.getEventDefinitions().get(0); } if (eventDefinition instanceof TimerEventDefinition || eventDefinition instanceof ErrorEventDefinition || eventDefinition instanceof SignalEventDefinition || eventDefinition instanceof CancelEventDefinition || eventDefinition instanceof MessageEventDefinition || eventDefinition instanceof CompensateEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else { // Should already be picked up by process validator on deploy, so this is just to be sure logger.warn("Unsupported boundary event type for boundary event " + boundaryEvent.getId()); } }
protected void handleBoundaryEvents() { for (BoundaryEvent boundaryEvent : boundaryEvents) { mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize); geometry.setOffset(new mxPoint(-(eventSize/2), -(eventSize/2))); geometry.setRelative(true); mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter"); boundaryPort.setId("boundary-event-" + boundaryEvent.getId()); boundaryPort.setVertex(true); Object portParent = null; if (boundaryEvent.getAttachedToRefId() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId()); } else if (boundaryEvent.getAttachedToRef() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId()); } else { throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef"); } graph.addCell(boundaryPort, portParent); generatedVertices.put(boundaryEvent.getId(), boundaryPort); } }
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) { BoundaryEvent boundaryEvent = (BoundaryEvent) baseElement; ArrayNode dockersArrayNode = objectMapper.createArrayNode(); ObjectNode dockNode = objectMapper.createObjectNode(); GraphicInfo graphicInfo = model.getGraphicInfo(boundaryEvent.getId()); GraphicInfo parentGraphicInfo = model.getGraphicInfo(boundaryEvent.getAttachedToRef().getId()); dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getX() - parentGraphicInfo.getX()); dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.getY() - parentGraphicInfo.getY()); dockersArrayNode.add(dockNode); flowElementNode.set("dockers", dockersArrayNode); propertiesNode.put(PROPERTY_CANCEL_ACTIVITY, boundaryEvent.isCancelActivity()); addEventProperties(boundaryEvent, propertiesNode); }
protected void dispatchExecutionCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity execution, CommandContext commandContext) { // subprocesses for (ExecutionEntity subExecution : execution.getExecutions()) { dispatchExecutionCancelled(eventSubscription, subExecution, commandContext); } // call activities ExecutionEntity subProcessInstance = commandContext.getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId()); if (subProcessInstance != null) { dispatchExecutionCancelled(eventSubscription, subProcessInstance, commandContext); } // activity with message/signal boundary events FlowElement flowElement = execution.getCurrentFlowElement(); if (flowElement instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement; if (boundaryEvent.getAttachedToRef() != null) { dispatchActivityCancelled(eventSubscription, execution, boundaryEvent.getAttachedToRef(), commandContext); } } }
if (currentElement instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) execution.getCurrentFlowElement(); if (boundaryEvent.isCancelActivity() && boundaryEvent.getAttachedToRef() != null) {
@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { BoundaryEvent boundaryEvent = (BoundaryEvent) element; if (boundaryEvent.getAttachedToRef() != null) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_ATTACHEDTOREF, boundaryEvent.getAttachedToRef().getId(), xtw); } if (boundaryEvent.getEventDefinitions().size() == 1) { EventDefinition eventDef = boundaryEvent.getEventDefinitions().get(0); if (eventDef instanceof ErrorEventDefinition == false) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_CANCELACTIVITY, String.valueOf(boundaryEvent.isCancelActivity()).toLowerCase(), xtw); } } }
@Override protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception { BoundaryEvent boundaryEvent = (BoundaryEvent) element; if (boundaryEvent.getAttachedToRef() != null) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_ATTACHEDTOREF, boundaryEvent.getAttachedToRef().getId(), xtw); } if (boundaryEvent.getEventDefinitions().size() == 1) { EventDefinition eventDef = boundaryEvent.getEventDefinitions().get(0); if (eventDef instanceof ErrorEventDefinition == false) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_CANCELACTIVITY, String.valueOf(boundaryEvent.isCancelActivity()).toLowerCase(), xtw); } } }
protected void executeParse(BpmnParse bpmnParse, BoundaryEvent boundaryEvent) { if (boundaryEvent.getAttachedToRef() == null) { logger.warn("Invalid reference in boundary event. Make sure that the referenced activity " + "is defined in the same scope as the boundary event " + boundaryEvent.getId()); return; } EventDefinition eventDefinition = null; if (boundaryEvent.getEventDefinitions().size() > 0) { eventDefinition = boundaryEvent.getEventDefinitions().get(0); } if (eventDefinition instanceof TimerEventDefinition || eventDefinition instanceof ErrorEventDefinition || eventDefinition instanceof SignalEventDefinition || eventDefinition instanceof CancelEventDefinition || eventDefinition instanceof MessageEventDefinition || eventDefinition instanceof CompensateEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else { // Should already be picked up by process validator on deploy, so this is just to be sure logger.warn("Unsupported boundary event type for boundary event " + boundaryEvent.getId()); } }
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) { BoundaryEvent boundaryEvent = (BoundaryEvent) baseElement; ArrayNode dockersArrayNode = objectMapper.createArrayNode(); ObjectNode dockNode = objectMapper.createObjectNode(); GraphicInfo graphicInfo = model.getGraphicInfo(boundaryEvent.getId()); GraphicInfo parentGraphicInfo = model.getGraphicInfo(boundaryEvent.getAttachedToRef().getId()); dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getX() - parentGraphicInfo.getX()); dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.getY() - parentGraphicInfo.getY()); dockersArrayNode.add(dockNode); flowElementNode.set("dockers", dockersArrayNode); propertiesNode.put(PROPERTY_CANCEL_ACTIVITY, boundaryEvent.isCancelActivity()); addEventProperties(boundaryEvent, propertiesNode); }
protected void dispatchExecutionCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity execution, CommandContext commandContext) { // subprocesses for (ExecutionEntity subExecution : execution.getExecutions()) { dispatchExecutionCancelled(eventSubscription, subExecution, commandContext); } // call activities ExecutionEntity subProcessInstance = commandContext.getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId()); if (subProcessInstance != null) { dispatchExecutionCancelled(eventSubscription, subProcessInstance, commandContext); } // activity with message/signal boundary events FlowElement flowElement = execution.getCurrentFlowElement(); if (flowElement instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement; if (boundaryEvent.getAttachedToRef() != null) { dispatchActivityCancelled(eventSubscription, execution, boundaryEvent.getAttachedToRef(), commandContext); } } }
if (currentElement instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) execution.getCurrentFlowElement(); if (boundaryEvent.isCancelActivity() && boundaryEvent.getAttachedToRef() != null) {