private static void adaptSequenceFlow(SequenceFlow sf, WithSequenceFlowsBean wfe, DefinitionsBean def){ SequenceFlowBean sfb = new SequenceFlowBean(sf.getId()); setDocumentationAndExtensions(sfb, sf); sfb.setName(sf.getName()); if(sf.getConditionExpression()!=null){ sfb.setExpression(adaptExpression(sf.getConditionExpression())); } sfb.setSourceNode((IFlowElementBean) elements.get(sf.getSourceRef().getId())); sfb.setTargetNode((IFlowElementBean) elements.get(sf.getTargetRef().getId())); wfe.addSequenceFlow(sfb); elements.put(sfb.getId(), sfb); if(defaultFlows.containsKey(sfb.getId())){ defaultFlows.get(sfb.getId()).setDefaultSequenceFlow(sfb); } }
public void bindSyntaxModel(IModelElement diagramElementSyntaxModel, IEditorModel editorModel, IDiagramElement diagramElement) { SequenceFlowBean bean = (SequenceFlowBean) diagramElementSyntaxModel; SequenceFlowEditorModel eModel = (SequenceFlowEditorModel) editorModel; bean.setName(eModel.getName()); bean.setDocumentation(eModel.getDocumentation()); if (eModel.getConditionnalExpression()!=null){ ExpressionBean exp = new ExpressionBean(IdGenerator.createUniqueId()); exp.setContent(eModel.getConditionnalExpression()); bean.setExpression(exp); } //set target and source IBPMNEdge sequenceFlowEdge = (IBPMNEdge) diagramElement; IBPMNShape source = (IBPMNShape) sequenceFlowEdge.getSource(); IBPMNShape target = (IBPMNShape) sequenceFlowEdge.getTarget(); if (source!=null){ if (source.getModelElement() instanceof IFlowElementBean) bean.setSourceNode((IFlowElementBean) source.getModelElement()); } if (target!=null){ if (target.getModelElement() instanceof IFlowElementBean) bean.setTargetNode((IFlowElementBean) target.getModelElement()); } }
sf5.setSourceNode(gateway); sf5.setTargetNode(task5); sf5.setName("Comments"); ExpressionBean expsf5 = new ExpressionBean(createUniqueId()); expsf5.setContent("Initial idea rejected"); sf7.setSourceNode(task5); sf7.setTargetNode(endEvent); sf7.setName("Decision"); process.addSequenceFlow(sf7); sf8.setSourceNode(task6); sf8.setTargetNode(endEvent); sf8.setName("Template"); process.addSequenceFlow(sf8);