public void parseElement(BpmnParse bpmnParse, BaseElement element) { if (element instanceof DataObject) { // ignore DataObject elements because they are processed on Process // and Sub process level return; } if (element instanceof FlowElement) { bpmnParse.setCurrentFlowElement((FlowElement) element); } // Execute parse handlers List<BpmnParseHandler> handlers = parseHandlers.get(element.getClass()); if (handlers == null) { LOGGER.warn("Could not find matching parse handler for + " + element.getId() + " this is likely a bug."); } else { for (BpmnParseHandler handler : handlers) { handler.parse(bpmnParse, element); } } }
public static void addXMLLocation(BaseElement element, XMLStreamReader xtr) { Location location = xtr.getLocation(); element.setXmlRowNumber(location.getLineNumber()); element.setXmlColumnNumber(location.getColumnNumber()); }
/** * add all attributes from XML to element extensionAttributes (except blackListed). * * @param xtr * @param element * @param blackLists */ public static void addCustomAttributes(XMLStreamReader xtr, BaseElement element, List<ExtensionAttribute>... blackLists) { for (int i = 0; i < xtr.getAttributeCount(); i++) { ExtensionAttribute extensionAttribute = new ExtensionAttribute(); extensionAttribute.setName(xtr.getAttributeLocalName(i)); extensionAttribute.setValue(xtr.getAttributeValue(i)); if (StringUtils.isNotEmpty(xtr.getAttributeNamespace(i))) { extensionAttribute.setNamespace(xtr.getAttributeNamespace(i)); } if (StringUtils.isNotEmpty(xtr.getAttributePrefix(i))) { extensionAttribute.setNamespacePrefix(xtr.getAttributePrefix(i)); } if (!isBlacklisted(extensionAttribute, blackLists)) { element.addAttribute(extensionAttribute); } } }
parentElement.addExtensionElement(extensionElement); continue; } else if (inExtensionElements) { ExtensionElement extensionElement = BpmnXMLUtil.parseExtensionElement(xtr); parentElement.addExtensionElement(extensionElement);
} else { ExtensionElement extensionElement = BpmnXMLUtil.parseExtensionElement(xtr); parentElement.addExtensionElement(extensionElement);
/** * This method makes coordinates of connection flow better. * @param processDiagramCanvas * @param bpmnModel * @param sourceElement * @param targetElement * @param graphicInfoList * @return */ protected static List<GraphicInfo> connectionPerfectionizer(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, BaseElement sourceElement, BaseElement targetElement, List<GraphicInfo> graphicInfoList) { GraphicInfo sourceGraphicInfo = bpmnModel.getGraphicInfo(sourceElement.getId()); GraphicInfo targetGraphicInfo = bpmnModel.getGraphicInfo(targetElement.getId()); DefaultProcessDiagramCanvas.SHAPE_TYPE sourceShapeType = getShapeType(sourceElement); DefaultProcessDiagramCanvas.SHAPE_TYPE targetShapeType = getShapeType(targetElement); return processDiagramCanvas.connectionPerfectionizer(sourceShapeType, targetShapeType, sourceGraphicInfo, targetGraphicInfo, graphicInfoList); }
public static void addXMLLocation(BaseElement element, XMLStreamReader xtr) { Location location = xtr.getLocation(); element.setXmlRowNumber(location.getLineNumber()); element.setXmlColumnNumber(location.getColumnNumber()); }
parentElement.addExtensionElement(extensionElement); continue; } else if (inExtensionElements) { ExtensionElement extensionElement = BpmnXMLUtil.parseExtensionElement(xtr); parentElement.addExtensionElement(extensionElement);
/** * add all attributes from XML to element extensionAttributes (except blackListed). * * @param xtr * @param element * @param blackList */ public static void addCustomAttributes(XMLStreamReader xtr, BaseElement element, List<ExtensionAttribute>... blackLists) { for (int i = 0; i < xtr.getAttributeCount(); i++) { ExtensionAttribute extensionAttribute = new ExtensionAttribute(); extensionAttribute.setName(xtr.getAttributeLocalName(i)); extensionAttribute.setValue(xtr.getAttributeValue(i)); if (StringUtils.isNotEmpty(xtr.getAttributeNamespace(i))) { extensionAttribute.setNamespace(xtr.getAttributeNamespace(i)); } if (StringUtils.isNotEmpty(xtr.getAttributePrefix(i))) { extensionAttribute.setNamespacePrefix(xtr.getAttributePrefix(i)); } if (!isBlacklisted(extensionAttribute, blackLists)) { element.addAttribute(extensionAttribute); } } }
protected void createDiagramInterchangeInformation(BaseElement element, List<mxPoint> waypoints) { List<GraphicInfo> graphicInfoForWaypoints = new ArrayList<GraphicInfo>(); for (mxPoint waypoint : waypoints) { GraphicInfo graphicInfo = new GraphicInfo(); graphicInfo.setElement(element); graphicInfo.setX(waypoint.getX()); graphicInfo.setY(waypoint.getY()); graphicInfoForWaypoints.add(graphicInfo); } bpmnModel.addFlowGraphicInfoList(element.getId(), graphicInfoForWaypoints); }
public static void addXMLLocation(BaseElement element, XMLStreamReader xtr) { Location location = xtr.getLocation(); element.setXmlRowNumber(location.getLineNumber()); element.setXmlColumnNumber(location.getColumnNumber()); }
} else { ExtensionElement extensionElement = BpmnXMLUtil.parseExtensionElement(xtr); parentElement.addExtensionElement(extensionElement);
this.subProcessY = subProcessY; this.shapesArrayNode = shapesArrayNode; GraphicInfo graphicInfo = model.getGraphicInfo(baseElement.getId()); flowElementNode = BpmnJsonConverterUtil.createChildShape(baseElement.getId(), stencilId, graphicInfo.getX() - subProcessX + graphicInfo.getWidth(), ObjectNode propertiesNode = objectMapper.createObjectNode(); propertiesNode.put(PROPERTY_OVERRIDE_ID, baseElement.getId()); if (artifact instanceof Association) { Association association = (Association) artifact; if (StringUtils.isNotEmpty(association.getSourceRef()) && association.getSourceRef().equals(baseElement.getId())) { outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(association.getId())); for (Process process : model.getProcesses()) { processDataStoreReferences(process, baseElement.getId(), outgoingArrayNode);
public void convertToXML(XMLStreamWriter xtw, BaseElement baseElement, BpmnModel model) throws Exception { xtw.writeStartElement(getXMLElementName()); boolean didWriteExtensionStartElement = false; writeDefaultAttribute(ATTRIBUTE_ID, baseElement.getId(), xtw); if (baseElement instanceof FlowElement) { writeDefaultAttribute(ATTRIBUTE_NAME, ((FlowElement) baseElement).getName(), xtw);
public void parseElement(BpmnParse bpmnParse, BaseElement element) { if (element instanceof FlowElement) { bpmnParse.setCurrentFlowElement((FlowElement) element); } // Execute parse handlers List<BpmnParseHandler> handlers = parseHandlers.get(element.getClass()); if (handlers == null) { LOGGER.warn("Could not find matching parse handler for + " + element.getId() + " this is likely a bug."); } else { for (BpmnParseHandler handler : handlers) { handler.parse(bpmnParse, element); } } }
public void parseElement(BpmnParse bpmnParse, BaseElement element) { if (element instanceof DataObject) { // ignore DataObject elements because they are processed on Process // and Sub process level return; } if (element instanceof FlowElement) { bpmnParse.setCurrentFlowElement((FlowElement) element); } // Execute parse handlers List<BpmnParseHandler> handlers = parseHandlers.get(element.getClass()); if (handlers == null) { LOGGER.warn("Could not find matching parse handler for + " + element.getId() + " this is likely a bug."); } else { for (BpmnParseHandler handler : handlers) { handler.parse(bpmnParse, element); } } }
@Override public void parse(BpmnParse bpmnParse, BaseElement element) { super.parse(bpmnParse, element); createExecutionListenersOnScope(bpmnParse, ((FlowNode) element).getExecutionListeners(), findActivity(bpmnParse, element.getId())); }
public void parse(BpmnParse bpmnParse, BaseElement element) { ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(element.getId()); activity.addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, ACTIVITY_INSTANCE_START_LISTENER, 0); activity.addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, ACTIVITI_INSTANCE_END_LISTENER); }
writeDefaultAttribute(ATTRIBUTE_ID, baseElement.getId(), xtw); if (baseElement instanceof FlowElement) { writeDefaultAttribute(ATTRIBUTE_NAME, ((FlowElement) baseElement).getName(), xtw);
this.subProcessY = subProcessY; this.shapesArrayNode = shapesArrayNode; GraphicInfo graphicInfo = model.getGraphicInfo(baseElement.getId()); flowElementNode = BpmnJsonConverterUtil.createChildShape(baseElement.getId(), stencilId, graphicInfo.getX() - subProcessX + graphicInfo.getWidth(), graphicInfo.getY() - subProcessY + graphicInfo.getHeight(), graphicInfo.getX() - subProcessX, graphicInfo.getY() - subProcessY); shapesArrayNode.add(flowElementNode); ObjectNode propertiesNode = objectMapper.createObjectNode(); propertiesNode.put(PROPERTY_OVERRIDE_ID, baseElement.getId()); if (artifact instanceof Association) { Association association = (Association) artifact; if (StringUtils.isNotEmpty(association.getSourceRef()) && association.getSourceRef().equals(baseElement.getId())) { outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(association.getId())); processDataStoreReferences(process, baseElement.getId(), outgoingArrayNode);