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 static SequenceFlow getSequenceFlow(WithFlowElements proc, String sourceId, String targetId) { for (SequenceFlow sf : proc.getFlowElementsByClass(SequenceFlow.class)) { if (sf.getSourceRef().getId().equals(sourceId) && sf.getTargetRef().getId().equals(targetId)) { return sf; } } return null; }
SequenceFlow sequenceFlow = newInstance(SequenceFlow.class); setDocumentationAndExtensions(sequenceFlow, sequenceFlowBean); sequenceFlow.setId(id); sequenceFlow.setName(sequenceFlowBean.getName()); exp.setId(sequenceFlowBean.getExpression().getId()); exp.setTextContent(sequenceFlowBean.getExpression().getContent()); sequenceFlow.setConditionExpression(exp); sequenceFlow.setSourceRef(source); FlowNode target = findFlowElementById(currentFlowElementContainer.peek(), sequenceFlowBean.getTargetNode().getId()); sequenceFlow.setTargetRef(target);
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); }
@Override public List<FlowNode> getOutgoingFlowNodes() { WithFlowElements wfe = DefinitionsHelper.getParentContainer(this); List<FlowNode> result = new ArrayList<FlowNode>(); if(wfe!=null && wfe.hasFlowElement()){ for(SequenceFlow sf : wfe.getFlowElementsByClass(SequenceFlow.class)){ if(sf.getSourceRef().equals(this)){ result.add(sf.getTargetRef()); } } } return result; }
private static void adaptSimpleTask(WithFlowElementsBean pBean, Task t, TaskBean tb, DefinitionsBean defs) { tb.setName(t.getName()); setDocumentationAndExtensions(tb, t); addDataAssociations(tb, t); tb.setIoSpecification(adaptIOSpecifications(t.getIoSpecification(), defs)); if(t.hasDefault()) { defaultFlows.put(t.getDefault().getId(), tb); } pBean.addTask(tb); elements.put(tb.getId(), tb); }
@Override public List<FlowNode> getIncomingFlowNodes() { WithFlowElements wfe = DefinitionsHelper.getParentContainer(this); List<FlowNode> result = new ArrayList<FlowNode>(); if(wfe!=null && wfe.hasFlowElement()){ for(SequenceFlow sf : wfe.getFlowElementsByClass(SequenceFlow.class)){ if(sf.getTargetRef().equals(this)){ result.add(sf.getSourceRef()); } } } return result; }