protected void setWaypoints(BpmnEdge edge) { BaseElement bpmnElement = edge.getBpmnElement(); FlowNode edgeSource; FlowNode edgeTarget; if (bpmnElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement; edgeSource = sequenceFlow.getSource(); edgeTarget = sequenceFlow.getTarget(); } else if (bpmnElement instanceof Association){ Association association = (Association) bpmnElement; edgeSource = (FlowNode) association.getSource(); edgeTarget = (FlowNode) association.getTarget(); } else { throw new RuntimeException("Bpmn element type not supported"); } setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget); }
public ModifiableBpmnModelInstance removeFlowNode(String flowNodeId) { FlowNode flowNode = getModelElementById(flowNodeId); ModelElementInstance scope = flowNode.getParentElement(); for (SequenceFlow outgoingFlow : flowNode.getOutgoing()) { removeBpmnEdge(outgoingFlow); scope.removeChildElement(outgoingFlow); } for (SequenceFlow incomingFlow : flowNode.getIncoming()) { removeBpmnEdge(incomingFlow); scope.removeChildElement(incomingFlow); } Collection<Association> associations = scope.getChildElementsByType(Association.class); for (Association association : associations) { if (flowNode.equals(association.getSource()) || flowNode.equals(association.getTarget())) { removeBpmnEdge(association); scope.removeChildElement(association); } } removeBpmnShape(flowNode); scope.removeChildElement(flowNode); return this; }
protected void setWaypoints(BpmnEdge edge) { BaseElement bpmnElement = edge.getBpmnElement(); FlowNode edgeSource; FlowNode edgeTarget; if (bpmnElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement; edgeSource = sequenceFlow.getSource(); edgeTarget = sequenceFlow.getTarget(); } else if (bpmnElement instanceof Association){ Association association = (Association) bpmnElement; edgeSource = (FlowNode) association.getSource(); edgeTarget = (FlowNode) association.getTarget(); } else { throw new RuntimeException("Bpmn element type not supported"); } setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget); }
protected void setWaypoints(BpmnEdge edge) { BaseElement bpmnElement = edge.getBpmnElement(); FlowNode edgeSource; FlowNode edgeTarget; if (bpmnElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement; edgeSource = sequenceFlow.getSource(); edgeTarget = sequenceFlow.getTarget(); } else if (bpmnElement instanceof Association){ Association association = (Association) bpmnElement; edgeSource = (FlowNode) association.getSource(); edgeTarget = (FlowNode) association.getTarget(); } else { throw new RuntimeException("Bpmn element type not supported"); } setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget); }
public ModifiableBpmnModelInstance removeFlowNode(String flowNodeId) { FlowNode flowNode = getModelElementById(flowNodeId); ModelElementInstance scope = flowNode.getParentElement(); for (SequenceFlow outgoingFlow : flowNode.getOutgoing()) { removeBpmnEdge(outgoingFlow); scope.removeChildElement(outgoingFlow); } for (SequenceFlow incomingFlow : flowNode.getIncoming()) { removeBpmnEdge(incomingFlow); scope.removeChildElement(incomingFlow); } Collection<Association> associations = scope.getChildElementsByType(Association.class); for (Association association : associations) { if (flowNode.equals(association.getSource()) || flowNode.equals(association.getTarget())) { removeBpmnEdge(association); scope.removeChildElement(association); } } removeBpmnShape(flowNode); scope.removeChildElement(flowNode); return this; }