Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.ChoreographyTask


    public void testIntermediateCatchCompensationEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateCatchCompensationEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        CatchEvent g = (CatchEvent) process.getFlowElements().get(0);
        assertEquals("catch compensation event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof CompensateEventDefinition);
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here


    public void testIntermediateCatchMultipleEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateCatchMultipleEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        CatchEvent g = (CatchEvent) process.getFlowElements().get(0);
        assertEquals("catch multiple event", g.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    public void testIntermediateCatchParallelMultipleEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateCatchParallelMultipleEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        CatchEvent g = (CatchEvent) process.getFlowElements().get(0);
        assertEquals("catch parallel multiple event", g.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.CHOREOGRAPHY_TASK: {
            ChoreographyTask choreographyTask = (ChoreographyTask) theEObject;
            T result = caseChoreographyTask(choreographyTask);
            if (result == null)
                result = caseChoreographyActivity(choreographyTask);
            if (result == null)
                result = caseFlowNode(choreographyTask);
View Full Code Here

      super(fp, "Choreography Task", "Represents interactions between two participants");
    }

    @Override
    protected ChoreographyTask createFlowElement(ICreateContext context) {
      ChoreographyTask task = ModelHandler.FACTORY.createChoreographyTask();
      task.setName("Choreography Task");
      task.setLoopType(ChoreographyLoopType.NONE);
      return task;
    }
View Full Code Here

  }

  public static void drawMessageLinks(ContainerShape choreographyContainer) {

    List<MessageFlow> messageFlows = new ArrayList<MessageFlow>();
    ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
        ChoreographyTask.class);
    if (choreography != null) {
      messageFlows.addAll(choreography.getMessageFlowRef());
    }

    List<ContainerShape> bandContainers = getParticipantBandContainerShapes(choreographyContainer);
    Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = getTopAndBottomBands(bandContainers);
    List<ContainerShape> shapesWithVisileMessages = new ArrayList<ContainerShape>();
View Full Code Here

  public IReason updateNeeded(IUpdateContext context) {
    if (!BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyTask.class)) {
      return Reason.createFalseReason();
    }

    ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        ChoreographyTask.class);

    String ids = peService.getPropertyValue(context.getPictogramElement(), MESSAGE_REF_IDS);
    String choreoIds = ChoreographyUtil.getMessageRefIds(choreography);
View Full Code Here

  @Override
  public boolean update(IUpdateContext context) {
    ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();

    ChoreographyTask choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
        ChoreographyTask.class);

    List<InteractionNode> sources = new ArrayList<InteractionNode>();
    for (MessageFlow message : choreography.getMessageFlowRef()) {
      sources.add(message.getSourceRef());
    }

    for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer)) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
View Full Code Here

        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("dataObject.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 2);
        Process process = getRootProcess(definitions);
        assertTrue(process.getFlowElements().iterator().next() instanceof DataObject);
        DataObject da = (DataObject) process.getFlowElements().iterator().next();
        assertEquals("data object", da.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    public void testDataStoreUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("dataStore.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().iterator().next() instanceof DataStore);
        DataStore da = (DataStore) definitions.getRootElements().iterator().next();
        assertEquals("data store", da.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.ChoreographyTask

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.