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; }
public void bindSyntaxModel(IModelElement diagramElementSyntaxModel, IEditorModel editorModel, IDiagramElement diagramElement) { MessageFlowBean bean = (MessageFlowBean) diagramElementSyntaxModel; MessageFlowEditorModel eModel = (MessageFlowEditorModel) editorModel; bean.setName(eModel.getName()); bean.setDocumentation(eModel.getDocumentation()); bean.setMessage(eModel.getMessage()); //set target and source IBPMNEdge messageFlowEdge = (IBPMNEdge) diagramElement; IBPMNShape source = (IBPMNShape) messageFlowEdge.getSource(); IBPMNShape target = (IBPMNShape) messageFlowEdge.getTarget(); if (source!=null){ if (source.getModelElement() instanceof IInteractionNodeBean) bean.setSource((IInteractionNodeBean)source.getModelElement()); } if (target!=null){ if (target.getModelElement() instanceof IInteractionNodeBean) bean.setTarget((IInteractionNodeBean)target.getModelElement()); } }
returnMessageFlow.setMessage(targetMessage); returnMessageFlow.setSource(sourceParticipant); returnMessageFlow.setTarget(choreoTask.getInitiatingParticipant());