Search in sources :

Example 11 with PvmExecution

use of org.camunda.bpm.engine.impl.pvm.PvmExecution in project camunda-bpm-platform by camunda.

the class PvmParallelTest method testSimpleWaitStateConcurrency.

public void testSimpleWaitStateConcurrency() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("fork").endActivity().createActivity("fork").behavior(new ParallelGateway()).transition("c1").transition("c2").endActivity().createActivity("c1").behavior(new WaitState()).transition("join").endActivity().createActivity("c2").behavior(new WaitState()).transition("join").endActivity().createActivity("join").behavior(new ParallelGateway()).transition("end").endActivity().createActivity("end").behavior(new WaitState()).endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
    PvmExecution activityInstanceC1 = processInstance.findExecution("c1");
    assertNotNull(activityInstanceC1);
    PvmExecution activityInstanceC2 = processInstance.findExecution("c2");
    assertNotNull(activityInstanceC2);
    activityInstanceC1.signal(null, null);
    activityInstanceC2.signal(null, null);
    List<String> activityNames = processInstance.findActiveActivityIds();
    List<String> expectedActivityNames = new ArrayList<String>();
    expectedActivityNames.add("end");
    assertEquals(expectedActivityNames, activityNames);
}
Also used : WaitState(org.camunda.bpm.engine.test.standalone.pvm.activities.WaitState) PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) ParallelGateway(org.camunda.bpm.engine.test.standalone.pvm.activities.ParallelGateway) ArrayList(java.util.ArrayList) PvmProcessDefinition(org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition) ProcessDefinitionBuilder(org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder) Automatic(org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic) PvmExecution(org.camunda.bpm.engine.impl.pvm.PvmExecution)

Aggregations

ProcessDefinitionBuilder (org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder)11 PvmExecution (org.camunda.bpm.engine.impl.pvm.PvmExecution)11 PvmProcessDefinition (org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition)11 PvmProcessInstance (org.camunda.bpm.engine.impl.pvm.PvmProcessInstance)11 WaitState (org.camunda.bpm.engine.test.standalone.pvm.activities.WaitState)11 Automatic (org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)9 End (org.camunda.bpm.engine.test.standalone.pvm.activities.End)7 EmbeddedSubProcess (org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess)4 ParallelGateway (org.camunda.bpm.engine.test.standalone.pvm.activities.ParallelGateway)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1 ExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl)1 PvmExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl)1 EventScopeCreatingSubprocess (org.camunda.bpm.engine.test.standalone.pvm.activities.EventScopeCreatingSubprocess)1 Test (org.junit.Test)1