private static List<IMessageFlowBean> buildMessageFlows() { List<IMessageFlowBean> result = new ArrayList<IMessageFlowBean>(); MessageFlowBean messageFlow1 = new MessageFlowBean(createUniqueId()); MF_1_ID = messageFlow1.getId(); messageFlow1.setSource((IInteractionNodeBean) upperParticipantNodes.get(0)); messageFlow1.setTarget((IInteractionNodeBean) lowerParticipantNodes.get(0)); MessageFlowBean messageFlow2 = new MessageFlowBean(createUniqueId()); MF_2_ID = messageFlow2.getId(); messageFlow2.setSource((IInteractionNodeBean) lowerParticipantNodes.get(1)); messageFlow2.setTarget((IInteractionNodeBean) upperParticipantNodes.get(1)); MessageFlowBean messageFlow3 = new MessageFlowBean(createUniqueId()); MF_3_ID = messageFlow3.getId(); messageFlow3.setSource((IInteractionNodeBean) upperParticipantNodes.get(2)); messageFlow3.setTarget((IInteractionNodeBean) lowerParticipantNodes.get(2)); result.add(messageFlow1); result.add(messageFlow2); result.add(messageFlow3); return result; }
private static MessageFlowBean adaptMessageFlow(MessageFlow mf, CollaborationBean cBean, DefinitionsBean defs) { MessageFlowBean mfBean = new MessageFlowBean(mf.getId()); mfBean.setName(mf.getName()); setDocumentationAndExtensions(mfBean, mf); if(mf.getMessageRef()!=null){ mfBean.setMessage(defs.getMessageById(mf.getMessageRef().getLocalPart())); } if(mf.getSourceRef()!=null){ // mfBean.setSource((IInteractionNodeBean) cBean.getFlowNode(mf.getSourceRef().getLocalPart())); mfBean.setSource((IInteractionNodeBean) elements.get(mf.getSourceRef().getLocalPart())); } if(mf.getTargetRef()!=null){ // mfBean.setTarget((IInteractionNodeBean) cBean.getFlowNode(mf.getTargetRef().getLocalPart())); mfBean.setTarget((IInteractionNodeBean) elements.get(mf.getTargetRef().getLocalPart())); } cBean.addMessageFlow(mfBean); elements.put(mfBean.getId(), mfBean); return mfBean; }
for(MessageFlow mf : chor.getMessageFlow()){ MessageFlowBean mfb = adaptMessageFlow(mf,cBean,def); elements.put(mfb.getId(), mfb);