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.setTargetNode((IFlowElementBean) ((IEdge)di).getTarget().getModelElement());
SequenceFlowBean sf1 = new SequenceFlowBean(UPPER_LANE_EL_12_ID); sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); process.addSequenceFlow(sf1); SequenceFlowBean sf2 = new SequenceFlowBean(UPPER_LANE_EL_13_ID); sf2.setSourceNode(task1); sf2.setTargetNode(task2); process.addSequenceFlow(sf2); SequenceFlowBean sf3 = new SequenceFlowBean(UPPER_LANE_EL_14_ID); sf3.setSourceNode(task2); sf3.setTargetNode(task3); process.addSequenceFlow(sf3); SequenceFlowBean sf4 = new SequenceFlowBean(UPPER_LANE_EL_15_ID); sf4.setSourceNode(task3); sf4.setTargetNode(task4); process.addSequenceFlow(sf4); SequenceFlowBean sf5 = new SequenceFlowBean(UPPER_LANE_EL_16_ID); sf5.setSourceNode(task4); sf5.setTargetNode(task5); process.addSequenceFlow(sf5); SequenceFlowBean sf6 = new SequenceFlowBean(UPPER_LANE_EL_17_ID); sf6.setSourceNode(task5); sf6.setTargetNode(gateway); process.addSequenceFlow(sf6);
SequenceFlowBean sf0 = new SequenceFlowBean(LOWER_LANE_EL_10_ID); sf0.setSourceNode(seb); sf0.setTargetNode(task1); process.addSequenceFlow(sf0); SequenceFlowBean sf1 = new SequenceFlowBean(LOWER_LANE_EL_11_ID); sf1.setSourceNode(task1); sf1.setTargetNode(task2); process.addSequenceFlow(sf1); SequenceFlowBean sf2 = new SequenceFlowBean(LOWER_LANE_EL_12_ID); sf2.setSourceNode(task2); sf2.setTargetNode(task3); process.addSequenceFlow(sf2); SequenceFlowBean sf3 = new SequenceFlowBean(LOWER_LANE_EL_13_ID); sf3.setSourceNode(task3); sf3.setTargetNode(gateway); process.addSequenceFlow(sf3); SequenceFlowBean sf4 = new SequenceFlowBean(LOWER_LANE_EL_14_ID); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean expsf4 = new ExpressionBean(createUniqueId()); expsf4.setContent("Initial idea accepted"); SequenceFlowBean sf5 = new SequenceFlowBean(LOWER_LANE_EL_15_ID); sf5.setSourceNode(gateway); sf5.setTargetNode(task5);
SequenceFlowBean sf1 = new SequenceFlowBean(UPPER_LANE_SF_1_ID); sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); process.addSequenceFlow(sf1); SequenceFlowBean sf2 = new SequenceFlowBean(UPPER_LANE_SF_2_ID); sf2.setSourceNode(task1); sf2.setTargetNode(gateway1); process.addSequenceFlow(sf2); SequenceFlowBean sf3 = new SequenceFlowBean(UPPER_LANE_SF_3_ID); sf3.setSourceNode(gateway1); sf3.setTargetNode(task2); process.addSequenceFlow(sf3); SequenceFlowBean sf4 = new SequenceFlowBean(UPPER_LANE_SF_4_ID); sf4.setSourceNode(gateway1); sf4.setTargetNode(task3); process.addSequenceFlow(sf4); SequenceFlowBean sf5 = new SequenceFlowBean(UPPER_LANE_SF_5_ID); sf5.setSourceNode(task2); sf5.setTargetNode(gateway2); process.addSequenceFlow(sf5); SequenceFlowBean sf6 = new SequenceFlowBean(UPPER_LANE_SF_6_ID); sf6.setSourceNode(task3); sf6.setTargetNode(gateway2); process.addSequenceFlow(sf6);
SequenceFlowBean sf = new SequenceFlowBean(LOWER_LANE_SF_0_ID); sf.setSourceNode(startEvent); sf.setTargetNode(task1); process.addSequenceFlow(sf); SequenceFlowBean sf1 = new SequenceFlowBean(LOWER_LANE_SF_1_ID); sf1.setSourceNode(task1); sf1.setTargetNode(task2); process.addSequenceFlow(sf1); SequenceFlowBean sf2 = new SequenceFlowBean(LOWER_LANE_SF_2_ID); sf2.setSourceNode(task2); sf2.setTargetNode(gateway); process.addSequenceFlow(sf2); SequenceFlowBean sf3 = new SequenceFlowBean(LOWER_LANE_SF_3_ID); sf3.setSourceNode(gateway); sf3.setTargetNode(task3); ExpressionBean exp = new ExpressionBean(createUniqueId()); exp.setContent("Real Alert"); SequenceFlowBean sf4 = new SequenceFlowBean(LOWER_LANE_SF_4_ID); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); exp2.setContent("Unimportant Alert"); SequenceFlowBean sf5 = new SequenceFlowBean(LOWER_LANE_SF_5_ID); sf5.setSourceNode(task3);
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()); } }
SequenceFlowBean sf1 = new SequenceFlowBean(UPPER_LANE_SF_1_ID); sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); process.addSequenceFlow(sf1); SequenceFlowBean sf2 = new SequenceFlowBean(UPPER_LANE_SF_2_ID); sf2.setSourceNode(task1); sf2.setTargetNode(task2); process.addSequenceFlow(sf2); SequenceFlowBean sf3 = new SequenceFlowBean(UPPER_LANE_SF_3_ID); sf3.setSourceNode(task2); sf3.setTargetNode(task3); process.addSequenceFlow(sf3); SequenceFlowBean sf4 = new SequenceFlowBean(UPPER_LANE_SF_4_ID); sf4.setSourceNode(task3); sf4.setTargetNode(task4); process.addSequenceFlow(sf4); SequenceFlowBean sf5 = new SequenceFlowBean(UPPER_LANE_SF_5_ID); sf5.setSourceNode(task4); sf5.setTargetNode(gateway); process.addSequenceFlow(sf5); SequenceFlowBean sf6 = new SequenceFlowBean(UPPER_LANE_SF_6_ID); sf6.setSourceNode(gateway); sf6.setTargetNode(task); ExpressionBean exp = new ExpressionBean(createUniqueId());
SequenceFlowBean sf = new SequenceFlowBean(LOWER_LANE_SF_0_ID); sf.setSourceNode(startEvent); sf.setTargetNode(task1); process.addSequenceFlow(sf); SequenceFlowBean sf1 = new SequenceFlowBean(LOWER_LANE_SF_1_ID); sf1.setSourceNode(task1); sf1.setTargetNode(task2); process.addSequenceFlow(sf1); SequenceFlowBean sf2 = new SequenceFlowBean(LOWER_LANE_SF_2_ID); sf2.setSourceNode(task2); sf2.setTargetNode(gateway); process.addSequenceFlow(sf2); SequenceFlowBean sf4 = new SequenceFlowBean(LOWER_LANE_SF_4_ID); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); exp2.setContent("No Mistakes"); sf5.setTargetNode(endEvent1); process.addSequenceFlow(sf5); SequenceFlowBean sf6 = new SequenceFlowBean(LOWER_LANE_SF_6_ID); sf6.setSourceNode(task4); sf6.setTargetNode(endEvent1); process.addSequenceFlow(sf6);
SequenceFlowBean sf1 = new SequenceFlowBean(PROCESS1_EL12_ID); sf1.setSourceNode(startEvent); sf1.setTargetNode(task1); SequenceFlowBean sf2 = new SequenceFlowBean(PROCESS1_EL13_ID); sf2.setSourceNode(task1); sf2.setTargetNode(task2); SequenceFlowBean sf3 = new SequenceFlowBean(PROCESS1_EL14_ID); sf3.setSourceNode(task2); sf3.setTargetNode(exclusiveGw1); sf4.setExpression(expSF4); sf4.setSourceNode(exclusiveGw1); sf4.setTargetNode(endEvent1); sf5.setExpression(expSF5); sf5.setSourceNode(exclusiveGw1); sf5.setTargetNode(pgwt1); SequenceFlowBean sf6 = new SequenceFlowBean(PROCESS1_EL17_ID); sf6.setSourceNode(pgwt1); sf6.setTargetNode(task3); SequenceFlowBean sf7 = new SequenceFlowBean(PROCESS1_EL18_ID); sf7.setSourceNode(pgwt1); sf7.setTargetNode(task4); SequenceFlowBean sf8 = new SequenceFlowBean(PROCESS1_EL19_ID);