private CanonicalProcessType buildCPF() { CanonicalProcessType cpf = new CanonicalProcessType(); NetType net = new NetType(); EventType event = new EventType(); event.setId("1"); event.setOriginalID("1"); event.setName("event"); TaskType task = new TaskType(); task.setId("2"); task.setOriginalID("2"); task.setName("task"); EdgeType edge = new EdgeType(); edge.setId("3"); edge.setOriginalID("3"); edge.setSourceId("1"); edge.setTargetId("2"); net.getNode().add(event); net.getNode().add(task); net.getEdge().add(edge); cpf.getNet().add(net); return cpf; }
/* loop through the list of edges and process each one. */ private void manipulateEdges( CanonicalProcessType cpf, AnnotationsType anf, Map<String, AnnotationData> annotations) { GraphicsType annotation; for (NetType net : cpf.getNet()) { for (EdgeType edge : net.getEdge()) { annotation = findGraphicsType(anf, edge.getId()); if (annotation != null) { manipulateEdge(annotation, edge, annotations); } } } }
/* loop through the list of nodes and process each one. */ private void manipulateShapes( CanonicalProcessType cpf, AnnotationsType anf, Map<String, AnnotationData> annotations) { GraphicsType annotation; for (NetType net : cpf.getNet()) { for (NodeType node : net.getNode()) { annotation = findGraphicsType(anf, node.getId()); if (annotation != null) { if (node instanceof EventType) { manipulateEvent(annotation, node, annotations); } else if (node instanceof TaskType) { manipulateTask(annotation, node, annotations); } } } } }