Examples of PvmProcessInstance


Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

      .endActivity()
      .executionListener(ExecutionListener.EVENTNAME_START, verifier)
      .executionListener(ExecutionListener.EVENTNAME_END, verifier)
    .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();

    assertTrue(processInstance.isEnded());

    verifier.assertStartInstanceCount(1, "start");
    verifier.assertProcessInstanceParent("start", processInstance);
    verifier.assertStartInstanceCount(1, "embeddedsubprocess");
    verifier.assertProcessInstanceParent("embeddedsubprocess", processInstance);
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

        .executionListener(ExecutionListener.EVENTNAME_START, verifier)
        .executionListener(ExecutionListener.EVENTNAME_END, verifier)
      .endActivity()
    .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();

    PvmExecution childExecution = processInstance.findExecution("two");
    String parentActivityInstanceId = ((ExecutionImpl)childExecution).getParentActivityInstanceId();
    assertEquals(((ExecutionImpl)processInstance).getId(), parentActivityInstanceId);

    childExecution.signal(null, null);
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

      .createActivity("end")
        .behavior(new Automatic())
      .endActivity()
    .buildProcessDefinition();
   
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
   
    boolean eventScopeFound = false;
    List<ExecutionImpl> executions = ((ExecutionImpl)processInstance).getExecutions();
    for (ExecutionImpl executionImpl : executions) {
      if(executionImpl.isEventScope()) {
        eventScopeFound = true;
        break;
      }
    }
   
    assertTrue(eventScopeFound);
   
    processInstance.signal(null, null);

    assertTrue(processInstance.isEnded());
        
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

      .createActivity("end")
        .behavior(new Automatic())
      .endActivity()
    .buildProcessDefinition();
   
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
   
    List<String> expectedActiveActivityIds = new ArrayList<String>();
    expectedActiveActivityIds.add("wait");
    assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds());
   

    PvmExecution execution = processInstance.findExecution("wait");
    execution.signal(null, null);
   
    assertTrue(processInstance.isEnded());
   
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

  public ReusableSubProcess(PvmProcessDefinition processDefinition) {
    this.processDefinition = processDefinition;
  }

  public void execute(ActivityExecution execution) throws Exception {
    PvmProcessInstance subProcessInstance = execution.createSubProcessInstance(processDefinition);

    // TODO set variables

    subProcessInstance.start();
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

        callActivityVariables.put(dataInputAssociation.getTarget(), value);
      }
    }

    PvmProcessInstance subProcessInstance = execution.createSubProcessInstance(processDefinition, businessKey);
    subProcessInstance.start(callActivityVariables);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

      Integer version = getVersion(execution);

      processDefinition = deploymentCache.findDeployedProcessDefinitionByKeyAndVersion(processDefinitionKey, version);
    }

    PvmProcessInstance caseInstance = execution.createSubProcessInstance(processDefinition, businessKey);
    caseInstance.start(variables);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

          .endActivity()
        .endActivity()
      .endActivity()
    .buildProcessDefinition();
   
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
   
    List<String> expectedEvents = new ArrayList<String>();
    expectedEvents.add("start on ProcessDefinition(scopes and events)");
    expectedEvents.add("start on Activity(mostOuterNestedActivity)");
    expectedEvents.add("start on Activity(outerScope)");
    expectedEvents.add("start on Activity(firstInnerScope)");
    expectedEvents.add("start on Activity(firstMostInnerNestedActivity)");
    expectedEvents.add("start on Activity(start)");
    expectedEvents.add("end on Activity(start)");
    expectedEvents.add("start on Activity(waitInFirst)");

    assertEquals("expected "+expectedEvents+", but was \n"+eventCollector+"\n", expectedEvents, eventCollector.events);
    eventCollector.events.clear();
   
    PvmExecution execution = processInstance.findExecution("waitInFirst");
    execution.signal(null, null);
   
    expectedEvents = new ArrayList<String>();
    expectedEvents.add("end on Activity(waitInFirst)");
    expectedEvents.add("end on Activity(firstMostInnerNestedActivity)");
    expectedEvents.add("end on Activity(firstInnerScope)");
    expectedEvents.add("start on Activity(secondInnerScope)");
    expectedEvents.add("start on Activity(secondMostInnerNestedActivity)");
    expectedEvents.add("start on Activity(waitInSecond)");

    assertEquals("expected "+expectedEvents+", but was \n"+eventCollector+"\n", expectedEvents, eventCollector.events);
    eventCollector.events.clear();
   
    execution = processInstance.findExecution("waitInSecond");
    execution.signal(null, null);
   
    expectedEvents = new ArrayList<String>();
    expectedEvents.add("end on Activity(waitInSecond)");
    expectedEvents.add("start on Activity(end)");
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

        .endActivity()
      .endActivity()
    .buildProcessDefinition();
   
    ActivityImpl alternativeInitial = (ActivityImpl) processDefinition.findActivity("waitInFirst");
    PvmProcessInstance processInstance = ((ProcessDefinitionImpl)processDefinition).createProcessInstanceForInitial(alternativeInitial);
    processInstance.start();
   
    List<String> expectedEvents = new ArrayList<String>();
    expectedEvents.add("start on ProcessDefinition(scopes and events)");
    expectedEvents.add("start on Activity(mostOuterNestedActivity)");
    expectedEvents.add("start on Activity(outerScope)");
    expectedEvents.add("start on Activity(firstInnerScope)");
    expectedEvents.add("start on Activity(firstMostInnerNestedActivity)");
    expectedEvents.add("start on Activity(waitInFirst)");

    assertEquals("expected "+expectedEvents+", but was \n"+eventCollector+"\n", expectedEvents, eventCollector.events);
    eventCollector.events.clear();
   
    PvmExecution execution = processInstance.findExecution("waitInFirst");
    execution.signal(null, null);
   
    expectedEvents = new ArrayList<String>();
    expectedEvents.add("end on Activity(waitInFirst)");
    expectedEvents.add("end on Activity(firstMostInnerNestedActivity)");
    expectedEvents.add("end on Activity(firstInnerScope)");
    expectedEvents.add("start on Activity(secondInnerScope)");
    expectedEvents.add("start on Activity(secondMostInnerNestedActivity)");
    expectedEvents.add("start on Activity(waitInSecond)");

    assertEquals("expected "+expectedEvents+", but was \n"+eventCollector+"\n", expectedEvents, eventCollector.events);
    eventCollector.events.clear();
   
    execution = processInstance.findExecution("waitInSecond");
    execution.signal(null, null);
   
    expectedEvents = new ArrayList<String>();
    expectedEvents.add("end on Activity(waitInSecond)");
    expectedEvents.add("start on Activity(end)");
View Full Code Here

Examples of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance

        .initial()
        .behavior(new WaitState())
      .endActivity()
    .buildProcessDefinition();
     
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.setVariable("amount", 500L);
    processInstance.setVariable("msg", "hello world");
    processInstance.start();

    assertEquals(500L, processInstance.getVariable("amount"));
    assertEquals("hello world", processInstance.getVariable("msg"));

    PvmExecution activityInstance = processInstance.findExecution("a");
    assertEquals(500L, activityInstance.getVariable("amount"));
    assertEquals("hello world", activityInstance.getVariable("msg"));
   
    Map<String, Object> expectedVariables = new HashMap<String, Object>();
    expectedVariables.put("amount", 500L);
    expectedVariables.put("msg", "hello world");

    assertEquals(expectedVariables, activityInstance.getVariables());
    assertEquals(expectedVariables, processInstance.getVariables());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.