@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); String id = attrs.getValue("id"); String name = attrs.getValue("name"); WorkflowProcess process = (WorkflowProcess) parser.getParent(); List<Lane> lanes = (List<Lane>) ((RuleFlowProcess) process).getMetaData(LaneHandler.LANES); if (lanes == null) { lanes = new ArrayList<Lane>(); ((RuleFlowProcess) process).setMetaData(LaneHandler.LANES, lanes); } Lane lane = new Lane(id); lane.setName(name); lanes.add(lane); return lane; }
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { final Element element = parser.endElementBuilder(); Lane lane = (Lane) parser.getCurrent(); org.w3c.dom.Node xmlNode = element.getFirstChild(); while (xmlNode != null) { String nodeName = xmlNode.getNodeName(); if ("flowNodeRef".equals(nodeName)) { String flowElementRef = xmlNode.getTextContent(); lane.addFlowElement(flowElementRef); } xmlNode = xmlNode.getNextSibling(); } return lane; }
private void assignLanes(RuleFlowProcess process, List<Lane> lanes) { List<String> laneNames = new ArrayList<String>(); Map<String, String> laneMapping = new HashMap<String, String>(); if (lanes != null) { for (Lane lane: lanes) { String name = lane.getName(); if (name != null) { Swimlane swimlane = new Swimlane(); swimlane.setName(name); process.getSwimlaneContext().addSwimlane(swimlane); laneNames.add(name); for (String flowElementRef: lane.getFlowElements()) { laneMapping.put(flowElementRef, name); } } } } assignLanes(process, laneMapping); }
public Map<String, Object> getMetaData() { if (parent instanceof Node) { return ((Node) parent).getMetaData(); } else if (parent instanceof RuleFlowProcess) { return ((RuleFlowProcess) parent).getMetaData(); } else if (parent instanceof Variable) { return ((Variable) parent).getMetaData(); } else if (parent instanceof SequenceFlow) { return ((SequenceFlow) parent).getMetaData(); } else if(parent instanceof Lane) { return ((Lane) parent).getMetaData(); } else { throw new IllegalArgumentException("Unknown parent " + parent); } } public DataType getType() {
public Map<String, Object> getMetaData() { if (parent instanceof Node) { return ((Node) parent).getMetaData(); } else if (parent instanceof RuleFlowProcess) { return ((RuleFlowProcess) parent).getMetaData(); } else if (parent instanceof Variable) { return ((Variable) parent).getMetaData(); } else if (parent instanceof SequenceFlow) { return ((SequenceFlow) parent).getMetaData(); } else if(parent instanceof Lane) { return ((Lane) parent).getMetaData(); } else { throw new IllegalArgumentException("Unknown parent " + parent); } } public DataType getType() {
private void assignLanes(RuleFlowProcess process, List<Lane> lanes) { List<String> laneNames = new ArrayList<String>(); Map<String, String> laneMapping = new HashMap<String, String>(); if (lanes != null) { for (Lane lane: lanes) { String name = lane.getName(); if (name != null) { Swimlane swimlane = new Swimlane(); swimlane.setName(name); process.getSwimlaneContext().addSwimlane(swimlane); laneNames.add(name); for (String flowElementRef: lane.getFlowElements()) { laneMapping.put(flowElementRef, name); } } } } assignLanes(process, laneMapping); }
@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); String id = attrs.getValue("id"); String name = attrs.getValue("name"); WorkflowProcess process = (WorkflowProcess) parser.getParent(); List<Lane> lanes = (List<Lane>) ((RuleFlowProcess) process).getMetaData(LaneHandler.LANES); if (lanes == null) { lanes = new ArrayList<Lane>(); ((RuleFlowProcess) process).setMetaData(LaneHandler.LANES, lanes); } Lane lane = new Lane(id); lane.setName(name); lanes.add(lane); return lane; }
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { final Element element = parser.endElementBuilder(); Lane lane = (Lane) parser.getCurrent(); org.w3c.dom.Node xmlNode = element.getFirstChild(); while (xmlNode != null) { String nodeName = xmlNode.getNodeName(); if ("flowNodeRef".equals(nodeName)) { String flowElementRef = xmlNode.getTextContent(); lane.addFlowElement(flowElementRef); } xmlNode = xmlNode.getNextSibling(); } return lane; }