private <T extends IFlowElementBean> T searchListById(List<T> l, String id){ for(T t : l){ if(t.getId().equals(id)){ return t; } } return null; }
private <T extends IFlowElementBean> T searchListById(List<T> l, String id){ for(T t : l){ if(t.getId().equals(id)){ return t; } } return null; } @Override
private <T extends IFlowElementBean> T searchListById(List<T> l, String id){ for(T t : l){ if(t.getId().equals(id)){ return t; } } return null; }
private <T extends IFlowElementBean> T searchListById(List<T> l, String id){ for(T t : l){ if(t.getId().equals(id)){ return t; } } return null; }
private <T extends IFlowElementBean> T searchListById(List<T> l, String id){ for(T t : l){ if(t.getId().equals(id)){ return t; } } return null; }
private IFlowElementBean searchNodeById(List<? extends IFlowElementBean> flowNodes,String id) { if(flowNodes!=null){ int i = 0; boolean found = false; while(i<flowNodes.size() && !found){ IFlowElementBean node = flowNodes.get(i); if(node.getId().equals(id)){ return node; } else{ i++; } } } return null; } public List<IArtifactBean> getArtifacts() {
public IFlowElementBean getFlowNodeById(String id, ProcessBean proc){ for(IFlowElementBean fe : proc.getFlowNodes()){ if(fe.getId().equals(id)){ return fe; } } return null; }
@Override public IFlowElementBean getFlowNode(String id){ for(IFlowElementBean fe : getFlowNodes()) { if(fe.getId().equals(id)) { return fe; } } return null; } ////////////////////////////////////////////
private List<ISequenceFlowBean> findSFByTarget(IFlowElementBean target){ List<ISequenceFlowBean> result = new ArrayList<ISequenceFlowBean>(); for(ISequenceFlowBean sf : currentProcess.getSequenceFlows()){ if(sf.getTargetNode()==null){ continue; } if(sf.getTargetNode().getId().equals(target.getId())){ result.add(sf); } } return result; }
private List<ISequenceFlowBean> findSFBySource(IFlowElementBean source){ List<ISequenceFlowBean> result = new ArrayList<ISequenceFlowBean>(); for(ISequenceFlowBean sf : currentProcess.getSequenceFlows()){ if(sf.getSourceNode()==null){ continue; } if(sf.getSourceNode().getId().equals(source.getId())){ result.add(sf); } } return result; }
public IProcessBean getParentProcess(IFlowElementBean fe, IDefinitionsBean defs){ for(IProcessBean p : defs.getProcesses()){ for(IFlowElementBean elt : p.getFlowNodes()){ if(fe.getId().equals(elt.getId())){ return p; } } for(ISequenceFlowBean sf : p.getSequenceFlows()) { if(fe.getId().equals(sf.getId())){ return p; } } } return null; }
public List<ISequenceFlowBean> getOutgoingSequenceFlows(IFlowNodeBean fn, IDefinitionsBean defs) { IProcessBean proc = getParentProcess(fn, defs); if(proc==null) { return null; } List<ISequenceFlowBean> result = new ArrayList<ISequenceFlowBean>(); for(ISequenceFlowBean sf : proc.getSequenceFlows()) { if (sf.getSourceNode()==null) continue; if(sf.getSourceNode().getId().equals(fn.getId())) { result.add(sf); } } return result; }
private List<IMessageFlowBean> findMFByTarget(IFlowElementBean target){ List<IMessageFlowBean> result = new ArrayList<IMessageFlowBean>(); if(currentCollab.getMessageFlows()!=null){ for(IMessageFlowBean mf : currentCollab.getMessageFlows()){ if(mf.getTarget()==null){ continue; } if(mf.getTarget().getId().equals(target.getId())){ result.add(mf); } } } return result; }
@Override public void visitLane(ILaneBean laneBean) { Lane lane = newInstance(Lane.class); currentLaneSet.peek().addLane(lane); setDocumentationAndExtensions(lane,laneBean); lane.setName(laneBean.getName()); lane.setId(laneBean.getId()); for(IFlowElementBean fe : laneBean.getFlowNodes()){ if(fe instanceof IFlowNodeBean) { lane.addFlowNodeRef((FlowNode) currentFlowElementContainer.peek().getFlowElementById(fe.getId())); } } currentLane = lane; }
private static String findModelElementTargetId(BPMNEdge edge) { IBaseElementBean edgeModelElement = edge.getModelElement(); if(edgeModelElement instanceof ISequenceFlowBean) { return ((ISequenceFlowBean)edgeModelElement).getTargetNode().getId(); } else if(edgeModelElement instanceof IMessageFlowBean) { return ((IMessageFlowBean)edgeModelElement).getTarget().getId(); } else if(edgeModelElement instanceof IAssociationBean) { return ((IAssociationBean)edgeModelElement).getTarget().getId(); } return null; }
private static String findModelElementSourceId(BPMNEdge edge) { IBaseElementBean edgeModelElement = edge.getModelElement(); if(edgeModelElement instanceof ISequenceFlowBean) { return ((ISequenceFlowBean)edgeModelElement).getSourceNode().getId(); } else if(edgeModelElement instanceof IMessageFlowBean) { return ((IMessageFlowBean)edgeModelElement).getSource().getId(); } else if(edgeModelElement instanceof IAssociationBean) { return ((IAssociationBean)edgeModelElement).getSource().getId(); } return null; }
private static QName getEdgeSourceRef(IBPMNEdge edge) { IBaseElementBean edgeModelElement = edge.getModelElement(); String sourceId = null; if(edgeModelElement instanceof ISequenceFlowBean) { sourceId = ((ISequenceFlowBean)edgeModelElement).getSourceNode().getId(); } else if(edgeModelElement instanceof IMessageFlowBean) { sourceId = ((IMessageFlowBean)edgeModelElement).getSource().getId(); } else if(edgeModelElement instanceof IAssociationBean) { sourceId = ((IAssociationBean)edgeModelElement).getSource().getId(); } String edgeSourceElementId = edge.getSource().getModelElement().getId(); if(sourceId!=null && sourceId.equals(edgeSourceElementId)) { return null; } return new QName(edge.getSource().getId()); }
private static QName getEdgeTargetRef(IBPMNEdge edge) { IBaseElementBean edgeModelElement = edge.getModelElement(); String TargetId = null; if(edgeModelElement instanceof ISequenceFlowBean) { TargetId = ((ISequenceFlowBean)edgeModelElement).getTargetNode().getId(); } else if(edgeModelElement instanceof IMessageFlowBean) { TargetId = ((IMessageFlowBean)edgeModelElement).getTarget().getId(); } else if(edgeModelElement instanceof IAssociationBean) { TargetId = ((IAssociationBean)edgeModelElement).getTarget().getId(); } String edgeTargetElementId = edge.getTarget().getModelElement().getId(); if(TargetId!=null && TargetId.equals(edgeTargetElementId)) { return null; } return new QName(edge.getTarget().getId()); }
FlowNode source = findFlowElementById(currentFlowElementContainer.peek(),sequenceFlowBean.getSourceNode().getId()); sequenceFlow.setSourceRef(source); FlowNode target = findFlowElementById(currentFlowElementContainer.peek(), sequenceFlowBean.getTargetNode().getId()); sequenceFlow.setTargetRef(target);