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); } }
private static LaneBean buildLowerLane2(ProcessBean process) { LOWER_LANE_2_ID = createUniqueId(); LaneBean result = new LaneBean(LOWER_LANE_2_ID); result.setName("ReWriter"); LOWER_LANE_2_EL_ID = createUniqueId(); ServiceTaskBean task = new ServiceTaskBean(LOWER_LANE_2_EL_ID); task.setName("Refactor \r\n Document"); result.addTask(task); process.addTask(task); incomingSF.setTargetNode(task); outgoingSF.setSourceNode(task); return result; }
@Override public ParticipantBean getSyntaxModel() { ParticipantBean participant = (ParticipantBean) getMainDiagramElement().getModelElement(); //clean participants process first participant.getProcess().getLanes().clear(); participant.getProcess().clearFlowElements(); participant.getProcess().clearIOSpec(); //add all lanes (recursively) into participants process HashSet<LaneBean> lanes = (HashSet<LaneBean>) this.getAll(LaneBean.class, true); for(LaneBean lane:lanes){ participant.getProcess().addLane(lane); } //grab all sequence flows HashMap<IDiagramElement,SequenceFlowBean> sequenceFlows = (HashMap<IDiagramElement, SequenceFlowBean>) this.getEdges(SequenceFlowBean.class); for(IDiagramElement di:sequenceFlows.keySet()){ SequenceFlowBean s = sequenceFlows.get(di); s.setSourceNode((IFlowElementBean) ((IEdge)di).getSource().getModelElement()); s.setTargetNode((IFlowElementBean) ((IEdge)di).getTarget().getModelElement()); participant.getProcess().addSequenceFlow(s); } return participant; }
s.setSourceNode((IFlowElementBean) ((IEdge)di).getSource().getModelElement()); s.setTargetNode((IFlowElementBean) ((IEdge)di).getTarget().getModelElement());
sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); process.addSequenceFlow(sf1); sf2.setSourceNode(task1); sf2.setTargetNode(task2); process.addSequenceFlow(sf2); sf3.setSourceNode(task2); sf3.setTargetNode(task3); process.addSequenceFlow(sf3); sf4.setSourceNode(task3); sf4.setTargetNode(task4); process.addSequenceFlow(sf4); sf5.setSourceNode(task4); sf5.setTargetNode(task5); process.addSequenceFlow(sf5); sf6.setSourceNode(task5); sf6.setTargetNode(gateway); process.addSequenceFlow(sf6); sf7.setSourceNode(gateway); sf7.setTargetNode(task6); ExpressionBean expsf7 = new ExpressionBean(createUniqueId()); sf8.setSourceNode(gateway);
sf0.setSourceNode(seb); sf0.setTargetNode(task1); process.addSequenceFlow(sf0); sf1.setSourceNode(task1); sf1.setTargetNode(task2); process.addSequenceFlow(sf1); sf2.setSourceNode(task2); sf2.setTargetNode(task3); process.addSequenceFlow(sf2); sf3.setSourceNode(task3); sf3.setTargetNode(gateway); process.addSequenceFlow(sf3); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean expsf4 = new ExpressionBean(createUniqueId()); sf5.setSourceNode(gateway); sf5.setTargetNode(task5); sf5.setName("Comments"); sf6.setSourceNode(task4); sf6.setTargetNode(task6); process.addSequenceFlow(sf6); sf7.setSourceNode(task5);
sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); process.addSequenceFlow(sf1); sf2.setSourceNode(task1); sf2.setTargetNode(gateway1); process.addSequenceFlow(sf2); sf3.setSourceNode(gateway1); sf3.setTargetNode(task2); process.addSequenceFlow(sf3); sf4.setSourceNode(gateway1); sf4.setTargetNode(task3); process.addSequenceFlow(sf4); sf5.setSourceNode(task2); sf5.setTargetNode(gateway2); process.addSequenceFlow(sf5); sf6.setSourceNode(task3); sf6.setTargetNode(gateway2); process.addSequenceFlow(sf6); sf7.setSourceNode(gateway2); sf7.setTargetNode(task4); process.addSequenceFlow(sf7); sf8.setSourceNode(task4);
sf.setSourceNode(startEvent); sf.setTargetNode(task1); process.addSequenceFlow(sf); sf1.setSourceNode(task1); sf1.setTargetNode(task2); process.addSequenceFlow(sf1); sf2.setSourceNode(task2); sf2.setTargetNode(gateway); process.addSequenceFlow(sf2); sf3.setSourceNode(gateway); sf3.setTargetNode(task3); ExpressionBean exp = new ExpressionBean(createUniqueId()); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); sf5.setSourceNode(task3); sf5.setTargetNode(endEvent1); process.addSequenceFlow(sf5); sf6.setSourceNode(task4); sf6.setTargetNode(endEvent2); process.addSequenceFlow(sf6);
s.setSourceNode((IFlowElementBean) ((IEdge)di).getSource().getModelElement()); s.setTargetNode((IFlowElementBean) ((IEdge)di).getTarget().getModelElement());
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()); } }
sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); process.addSequenceFlow(sf1); sf2.setSourceNode(task1); sf2.setTargetNode(task2); process.addSequenceFlow(sf2); sf3.setSourceNode(task2); sf3.setTargetNode(task3); process.addSequenceFlow(sf3); sf4.setSourceNode(task3); sf4.setTargetNode(task4); process.addSequenceFlow(sf4); sf5.setSourceNode(task4); sf5.setTargetNode(gateway); process.addSequenceFlow(sf5); sf6.setSourceNode(gateway); sf6.setTargetNode(task); ExpressionBean exp = new ExpressionBean(createUniqueId()); sf7.setSourceNode(gateway); sf7.setTargetNode(task5); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); sf8.setSourceNode(task);
sf.setSourceNode(startEvent); sf.setTargetNode(task1); process.addSequenceFlow(sf); sf1.setSourceNode(task1); sf1.setTargetNode(task2); process.addSequenceFlow(sf1); sf2.setSourceNode(task2); sf2.setTargetNode(gateway); process.addSequenceFlow(sf2); sf3.setSourceNode(gateway); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); sf6.setSourceNode(task4); sf6.setTargetNode(endEvent1); process.addSequenceFlow(sf6);
sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); sf2.setSourceNode(task1); sf2.setTargetNode(task2); sf3.setSourceNode(task2); sf3.setTargetNode(exclusiveGw1); expSF4.setContent("Rejected"); sf4.setExpression(expSF4); sf4.setSourceNode(exclusiveGw1); sf4.setTargetNode(endEvent1); expSF5.setContent("Approved"); sf5.setExpression(expSF5); sf5.setSourceNode(exclusiveGw1); sf5.setTargetNode(pgwt1); sf6.setSourceNode(pgwt1); sf6.setTargetNode(task3); sf7.setSourceNode(pgwt1); sf7.setTargetNode(task4); sf8.setSourceNode(task3); sf8.setTargetNode(pgwt2); sf9.setSourceNode(task4);