Package org.activiti.workflow.simple.definition

Examples of org.activiti.workflow.simple.definition.ParallelStepsDefinition


    WorkflowDefinition parsedDefinition = converter.readWorkflowDefinition(baos.toByteArray());

    // Check if parsed definition matches the original one
    assertEquals(workflowDefinition.getName(), parsedDefinition.getName());
    assertEquals(workflowDefinition.getDescription(), parsedDefinition.getDescription());
    ParallelStepsDefinition parallelDef = null;
    for (StepDefinition step : parsedDefinition.getSteps()) {
      if (step instanceof ParallelStepsDefinition) {
        parallelDef = (ParallelStepsDefinition) step;
      }
    }
    assertNotNull(parallelDef);
    assertEquals(2, parallelDef.getStepList().size());
   
    ListStepDefinition<ParallelStepsDefinition> listSteps = parallelDef.getStepList().get(0);
    assertEquals(2, listSteps.getSteps().size());
   
    listSteps = parallelDef.getStepList().get(1);
    assertEquals(1, listSteps.getSteps().size());
  }
View Full Code Here


      for (int i=0; i<steps.size(); i++) {
        HumanStepDefinition currentStep = steps.get(i);
       
        // Check if we have a parallel block
        int nextIndex = i+1;
        ParallelStepsDefinition parallelStepsDefinition = null;
        while (nextIndex < steps.size() && steps.get(nextIndex).isStartsWithPrevious()) {
          if (parallelStepsDefinition == null) {
            parallelStepsDefinition = new ParallelStepsDefinition();
            ListStepDefinition<ParallelStepsDefinition> listStepDef = new ListStepDefinition<ParallelStepsDefinition>();
            listStepDef.addStep(currentStep);
            parallelStepsDefinition.addStepList(listStepDef);
          }
         
          ListStepDefinition<ParallelStepsDefinition> listStepDef = new ListStepDefinition<ParallelStepsDefinition>();
          listStepDef.addStep(steps.get(nextIndex));
          parallelStepsDefinition.addStepList(listStepDef);
          nextIndex++;
        }
       
        if (parallelStepsDefinition != null) {
          workflow.addStep(parallelStepsDefinition);
View Full Code Here

TOP

Related Classes of org.activiti.workflow.simple.definition.ParallelStepsDefinition

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.