@Override public void visitMessageFlow(IMessageFlowBean mfb){ if(mfb.getSource()==null){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_NO_SOURCE.getMessage()); return; if(mfb.getTarget()==null){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_NO_TARGET.getMessage()); 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()); if(!canBeMFTarget(mfb.getTarget())){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_WRONG_TARGET.getMessage()); IParticipantBean p1 = findEnclosingPool(mfb.getSource()); IParticipantBean p2 = findEnclosingPool(mfb.getTarget()); if(p1.equals(p2)){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MF_SAME_POOL.getMessage()); List<IMessageFlowBean> sameSource = findMFBySource(mfb.getSource()); if(sameSource.isEmpty() || sameSource.size()>1){ validationErrors.put(mfb.getId(), BPMNValidationErrorMessage.MULTIPLE_OUGOING_MF.getMessage());
@Override public void visitMessageFlow(IMessageFlowBean msgFlowBean) { MessageFlow msgFlow = newInstance(MessageFlow.class); msgFlow.setId(msgFlowBean.getId()); msgFlow.setName(msgFlowBean.getName()); setDocumentationAndExtensions(msgFlow, msgFlowBean); currentCollaboration.addMessageFlow(msgFlow); currentMessageFlow = msgFlow; }
this.visitMessageFlow(mfb); IMessageBean mb = mfb.getMessage(); if(mb!=null){ this.visitMessageFlowMessage(mb); IInteractionNodeBean node = mfb.getSource(); if(node!=null){ this.visitMessageFlowSource(node); node = mfb.getTarget(); if(node!=null){ this.visitMessageFlowTarget(node);
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; }
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.getId().equals(this.id) && bean==null){bean = mfb;} } @Override
choreoTask.getInitiatingMessageFlow().setMessage(targetMessage);
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; }
@Override public void visitChoreographyTask(IChoreographyTaskBean cTask){ ChoreographyTask ct = newInstance(ChoreographyTask.class); ct.setId(cTask.getId()); ct.setName(cTask.getName()); setDocumentationAndExtensions(ct, cTask); ct.setLoopType(retrieveChoreographyLoopType(cTask.getChoreographyLoopType())); ct.setInitiatingParticipantRef(new QName(cTask.getInitiatingParticipant().getId())); if(cTask.getParticipants()!=null){ for(IParticipantBean p : cTask.getParticipants()){ ct.addParticipantRef(new QName(p.getId())); } } if(cTask.getInitiatingMessageFlow()!=null){ ct.addMessageFlowRef(new QName(cTask.getInitiatingMessageFlow().getId())); } if(cTask.getReturnMessageFlow()!=null){ ct.addMessageFlowRef(new QName(cTask.getReturnMessageFlow().getId())); } currentFlowElementContainer.peek().addFlowElement(ct); }
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()); }
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()); }