public ExclusiveGatewayBean(String id){ super(id); this.setIncomingActivities(null); this.setOutgoingActivities(null); this.setDefaultSequenceFlow(null); }
public ParallelGatewayBean(String id){ super(id); this.setIncomingActivities(null); this.setOutgoingActivities(null); }
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()); } }
ParallelGatewayBean gateway1 = new ParallelGatewayBean(UPPER_LANE_EL_3_ID); gateway1.setName("Work Distribution"); result.addGateway(gateway1); process.addGateway(gateway1); ParallelGatewayBean gateway2 = new ParallelGatewayBean(UPPER_LANE_EL_6_ID); gateway2.setName("Work Aggregation"); result.addGateway(gateway2); process.addGateway(gateway2); 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);
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; }
private static void adaptEventBasedGateway(WithGatewaysBean pBean, EventBasedGateway eg) { EventBasedGatewayBean pgb = new EventBasedGatewayBean(eg.getId()); pgb.setName(eg.getName()); setDocumentationAndExtensions(pgb, eg); pgb.setInstantiate(eg.isInstantiate()); pgb.setType(retrieveEventGatewayType(eg.getEventGatewayType())); pBean.addGateway(pgb); elements.put(pgb.getId(), pgb); }
private static void adaptParallelGateway(WithGatewaysBean pBean, ParallelGateway pg) { ParallelGatewayBean pgb = new ParallelGatewayBean(pg.getId()); pgb.setName(pg.getName()); setDocumentationAndExtensions(pgb, pg); pBean.addGateway(pgb); elements.put(pgb.getId(), pgb); }
private void eventBasedBind(){ commonBind(); EventBasedGatewayBean eventBasedGatewayBean = (EventBasedGatewayBean) this.diagramElementSyntaxModel; EventBasedGatewayEditorModel editorModel = (EventBasedGatewayEditorModel) this.editorModel; eventBasedGatewayBean.setInstantiate(editorModel.isInstantiate()); eventBasedGatewayBean.setType(editorModel.getType()); }
private void adaptEventBasedGateway(EventBasedGatewayBean gb) { EventBasedGateway eg = newInstance(EventBasedGateway.class); setDocumentationAndExtensions(eg, gb); eg.setId(gb.getId()); eg.setName(gb.getName()); eg.setInstantiate(gb.isInstantiate()); eg.setEventGatewayType(retrieveEventGatewayType(gb.getType())); currentFlowElementContainer.peek().addFlowElement(eg); }
private static void adaptExclusiveGateway(WithGatewaysBean pBean, ExclusiveGateway eg) { ExclusiveGatewayBean egb = new ExclusiveGatewayBean(eg.getId()); egb.setName(eg.getName()); setDocumentationAndExtensions(egb, eg); if(eg.getDefault()!=null){ defaultFlows.put(eg.getDefault().getId(), egb); } pBean.addGateway(egb); elements.put(egb.getId(), egb); }
private void adaptExclusiveGateway(ExclusiveGatewayBean gatewayBean) { ExclusiveGateway eg = newInstance(ExclusiveGateway.class); setDocumentationAndExtensions(eg, gatewayBean); eg.setId(gatewayBean.getId()); eg.setName(gatewayBean.getName()); if(gatewayBean.getDefaultSequenceFlow()!=null){ defaultFlows.put(gatewayBean.getDefaultSequenceFlow().getId(), eg); } currentFlowElementContainer.peek().addFlowElement(eg); }
@Override public void bind(SequenceFlowEditorModel watchedModel, SequenceFlowBean modelToBind) { IExpressionBean exp = new ExpressionBean(); exp.setContent(watchedModel.getConditionnalExpression()); modelToBind.setExpression(exp); }
private void commonBind() { GatewayBean gatewayBean = (GatewayBean) this.diagramElementSyntaxModel; CommonEditorModel commonEditorModel = (CommonEditorModel) this.editorModel; gatewayBean.setName(commonEditorModel.getName()); gatewayBean.setDocumentation(commonEditorModel.getDocumentation()); }
private void exclusiveBind(){ commonBind(); ExclusiveGatewayBean exclusiveGatewayBean = (ExclusiveGatewayBean) this.diagramElementSyntaxModel; ExclusiveGatewayEditorModel editorModel = (ExclusiveGatewayEditorModel) this.editorModel; exclusiveGatewayBean.setDefaultSequenceFlow(editorModel.getDefaultSequenceFlow()); }
@Override public void initializeWatchedModel(SequenceFlowEditorModel watchedModel, SequenceFlowBean modelToBind) { if(modelToBind.getExpression()!=null) { watchedModel.setConditionnalExpression(modelToBind.getExpression().getContent()); } }
@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());