Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.FlowElementsContainer


            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.FLOW_ELEMENTS_CONTAINER: {
            FlowElementsContainer flowElementsContainer = (FlowElementsContainer) theEObject;
            T result = caseFlowElementsContainer(flowElementsContainer);
            if (result == null)
                result = caseBaseElement(flowElementsContainer);
            if (result == null)
                result = defaultCase(theEObject);
View Full Code Here


   * @param elem
   *            flow element to be added
   * @return
   */
  public <T extends FlowElement> T addFlowElement(Object target, T elem) {
    FlowElementsContainer container = getFlowElementContainer(target);
    container.getFlowElements().add(elem);
    return elem;
  }
View Full Code Here

    }
    return process.getIoSpecification();
  }

  public void moveFlowNode(FlowNode node, Object source, Object target) {
    FlowElementsContainer sourceContainer = getFlowElementContainer(source);
    FlowElementsContainer targetContainer = getFlowElementContainer(target);
    sourceContainer.getFlowElements().remove(node);
    targetContainer.getFlowElements().add(node);
    for (SequenceFlow flow : node.getOutgoing()) {
      sourceContainer.getFlowElements().remove(flow);
      targetContainer.getFlowElements().add(flow);
    }
  }
View Full Code Here

  public Lane createLane(Object target) {
    Lane lane = FACTORY.createLane();
//    lane.setId(EcoreUtil.generateUUID());
    ModelUtil.setID(lane,resource);
    FlowElementsContainer container = getFlowElementContainer(target);
    if (container.getLaneSets().isEmpty()) {
      LaneSet laneSet = FACTORY.createLaneSet();
//      laneSet.setId(EcoreUtil.generateUUID());
      container.getLaneSets().add(laneSet);
    }
    container.getLaneSets().get(0).getLanes().add(lane);
    ModelUtil.setID(lane);
    return lane;
  }
View Full Code Here

                } else {
                    if (child instanceof SequenceFlow) {
                        // for some reason sequence flows are placed as root elements.
                        // find if the target has a container, and if we can use it:
                        List<String> ids = _outgoingFlows.get(child);
                        FlowElementsContainer container = null;
                        for (String id : ids) { // yes, we iterate, but we'll take the first in the list that will work.
                            Object obj = _idMap.get(id);
                            if (obj instanceof EObject && ((EObject) obj).eContainer() instanceof FlowElementsContainer) {
                                container = (FlowElementsContainer) ((EObject) obj).eContainer();
                                break;
                            }
                        }
                        if (container != null) {
                            container.getFlowElements().add((SequenceFlow) child);
                            continue;
                        }
                       
                    }
                    if (child instanceof Task || child instanceof SequenceFlow
View Full Code Here

                break;
            }
        }
        assertNotNull(process);
       
        FlowElementsContainer container = null;
        for (FlowElement element : process.getFlowElements()) {
            if (element instanceof AdHocSubProcess) {
                container = (FlowElementsContainer) element;
                break;
            }
View Full Code Here

                break;
            }
        }
        assertNotNull(process);
       
        FlowElementsContainer container = null;
        for (FlowElement element : process.getFlowElements()) {
            if (element instanceof SubProcess) {
                container = (FlowElementsContainer) element;
                break;
            }
View Full Code Here

    // removing until we start supporting global tasks
    public void testBusinessRuleTaskUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("businessRuleTask.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        GlobalBusinessRuleTask task = (GlobalBusinessRuleTask) definitions.getRootElements().get(0);
        assertEquals("call business rule", task.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    // removing until we start supporting global tasks
    public void testManualTaskUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("manualTask.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        GlobalManualTask task = (GlobalManualTask) definitions.getRootElements().get(0);
        assertEquals("pull a lever", task.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    // removing until we start supporting global tasks
    public void testScriptTaskUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("scriptTask.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        GlobalScriptTask task = (GlobalScriptTask) definitions.getRootElements().get(0);
        assertEquals("my script", task.getName());
        assertEquals("git status | grep modified | awk '{print $3}' | xargs echo | xargs git add", task.getScript());
        assertEquals("bash", task.getScriptLanguage());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.FlowElementsContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.