private List<IMessageFlowBean> findMFBySource(IInteractionNodeBean iInteractionNodeBean){ List<IMessageFlowBean> result = new ArrayList<IMessageFlowBean>(); if(currentCollab.getMessageFlows()!=null){ for(IMessageFlowBean mf : currentCollab.getMessageFlows()){ if(mf.getSource()==null){ continue; } if(mf.getSource().getId().equals(iInteractionNodeBean.getId())){ result.add(mf); } } } return result; }
@Override public void visitMessageFlow(IMessageFlowBean mfb){ if(mfb.getSource()==null){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_NO_SOURCE.getMessage()); return; return; if(mfb.getSource().equals(mfb.getTarget())){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_SAME_SOURCE_TARGET.getMessage()); return; if(!canBeMFSource(mfb.getSource())){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_WRONG_SOURCE.getMessage()); IParticipantBean p1 = findEnclosingPool(mfb.getSource()); IParticipantBean p2 = findEnclosingPool(mfb.getTarget()); if(p1.equals(p2)){ List<IMessageFlowBean> sameSource = findMFBySource(mfb.getSource()); if(sameSource.isEmpty() || sameSource.size()>1){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MULTIPLE_OUGOING_MF.getMessage());
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()); }
IInteractionNodeBean node = mfb.getSource(); if(node!=null){ this.visitMessageFlowSource(node);