Search in sources :

Example 31 with Automatic

use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.

the class PvmEmbeddedSubProcessTest method testMultipleConcurrentEndsInsideEmbeddedSubProcess.

/**
 *           +----------------------------------------+
 *           | embeddedsubprocess        +----------+ |
 *           |                     +---->|endInside1| |
 *           |                     |     +----------+ |
 *           |                     |                  |
 * +-----+   |  +-----------+   +----+   +----------+ |   +---+
 * |start|-->|  |startInside|-->|fork|-->|endInside2| |-->|end|
 * +-----+   |  +-----------+   +----+   +----------+ |   +---+
 *           |                     |                  |
 *           |                     |     +----------+ |
 *           |                     +---->|endInside3| |
 *           |                           +----------+ |
 *           +----------------------------------------+
 */
public void testMultipleConcurrentEndsInsideEmbeddedSubProcess() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).createActivity("startInside").behavior(new Automatic()).transition("fork").endActivity().createActivity("fork").behavior(new ParallelGateway()).transition("endInside1").transition("endInside2").transition("endInside3").endActivity().createActivity("endInside1").behavior(new End()).endActivity().createActivity("endInside2").behavior(new End()).endActivity().createActivity("endInside3").behavior(new End()).endActivity().transition("end").endActivity().createActivity("end").behavior(new End()).endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
    assertTrue(processInstance.isEnded());
}
Also used : EmbeddedSubProcess(org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess) PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) ParallelGateway(org.camunda.bpm.engine.test.standalone.pvm.activities.ParallelGateway) PvmProcessDefinition(org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition) End(org.camunda.bpm.engine.test.standalone.pvm.activities.End) ProcessDefinitionBuilder(org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder) Automatic(org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)

Example 32 with Automatic

use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.

the class PvmEmbeddedSubProcessTest method testEmbeddedSubProcessWithoutEndEvents.

/**
 *           +------------------------------+
 *           | embedded subprocess          |
 * +-----+   |  +-----------+               |
 * |start|-->|  |startInside|               |
 * +-----+   |  +-----------+               |
 *           +------------------------------+
 */
public void testEmbeddedSubProcessWithoutEndEvents() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).createActivity("startInside").behavior(new Automatic()).endActivity().endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
    assertTrue(processInstance.isEnded());
}
Also used : EmbeddedSubProcess(org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess) PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) 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)

Example 33 with Automatic

use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.

the class PvmEmbeddedSubProcessTest method testNestedSubProcessBothNoEnd.

/**
 *           +-------------------------------------------------------+
 *           | embedded subprocess                                   |
 *           |                  +--------------------------------+   |
 *           |                  | nested embedded subprocess     |   |
 * +-----+   | +-----------+    |  +-----------+                 |   |
 * |start|-->| |startInside|--> |  |startInside|                 |   |
 * +-----+   | +-----------+    |  +-----------+                 |   |
 *           |                  +--------------------------------+   |
 *           |                                                       |
 *           +-------------------------------------------------------+
 */
public void testNestedSubProcessBothNoEnd() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).createActivity("startInside").behavior(new Automatic()).transition("nestedSubProcess").endActivity().createActivity("nestedSubProcess").scope().behavior(new EmbeddedSubProcess()).createActivity("startNestedInside").behavior(new Automatic()).endActivity().endActivity().endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
    assertTrue(processInstance.isEnded());
}
Also used : EmbeddedSubProcess(org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess) PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) 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)

Example 34 with Automatic

use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.

the class PvmEmbeddedSubProcessTest method testNestedSubProcessNoEnd.

/**
 *           +-------------------------------------------------------+
 *           | embedded subprocess                                   |
 *           |                  +--------------------------------+   |
 *           |                  | nested embedded subprocess     |   |
 * +-----+   | +-----------+    |  +-----------+   +---------+   |   |   +---+
 * |start|-->| |startInside|--> |  |startInside|-->|endInside|   |   |-->|end|
 * +-----+   | +-----------+    |  +-----------+   +---------+   |   |   +---+
 *           |                  +--------------------------------+   |
 *           |                                                       |
 *           +-------------------------------------------------------+
 */
public void testNestedSubProcessNoEnd() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).createActivity("startInside").behavior(new Automatic()).transition("nestedSubProcess").endActivity().createActivity("nestedSubProcess").scope().behavior(new EmbeddedSubProcess()).createActivity("startNestedInside").behavior(new Automatic()).transition("endInside").endActivity().createActivity("endInside").behavior(new End()).endActivity().endActivity().transition("end").endActivity().createActivity("end").behavior(new WaitState()).endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();
    List<String> expectedActiveActivityIds = new ArrayList<String>();
    expectedActiveActivityIds.add("end");
    assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds());
}
Also used : EmbeddedSubProcess(org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess) WaitState(org.camunda.bpm.engine.test.standalone.pvm.activities.WaitState) PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) ArrayList(java.util.ArrayList) PvmProcessDefinition(org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition) End(org.camunda.bpm.engine.test.standalone.pvm.activities.End) ProcessDefinitionBuilder(org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder) Automatic(org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)

Example 35 with Automatic

use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.

the class PvmEmbeddedSubProcessTest method testStartInScope.

/**
 *           +------------------------------+
 *           | embedded subprocess          |
 * +-----+   |  +-----------+   +---------+ |   +---+
 * |start|-->|  |startInside|-->|endInside| |-->|end|
 * +-----+   |  +-----------+   +---------+ |   +---+
 *           +------------------------------+
 */
public void testStartInScope() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).createActivity("startInside").behavior(new Automatic()).transition("endInside").endActivity().createActivity("endInside").behavior(new End()).endActivity().transition("end").endActivity().createActivity("end").behavior(new WaitState()).endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = ((ProcessDefinitionImpl) processDefinition).createProcessInstanceForInitial((ActivityImpl) processDefinition.findActivity("startInside"));
    processInstance.start();
    List<String> expectedActiveActivityIds = new ArrayList<String>();
    expectedActiveActivityIds.add("end");
    assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds());
}
Also used : EmbeddedSubProcess(org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess) WaitState(org.camunda.bpm.engine.test.standalone.pvm.activities.WaitState) PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) ProcessDefinitionImpl(org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl) ArrayList(java.util.ArrayList) PvmProcessDefinition(org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition) End(org.camunda.bpm.engine.test.standalone.pvm.activities.End) ProcessDefinitionBuilder(org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder) Automatic(org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)

Aggregations

ProcessDefinitionBuilder (org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder)43 PvmProcessDefinition (org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition)43 PvmProcessInstance (org.camunda.bpm.engine.impl.pvm.PvmProcessInstance)43 Automatic (org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)43 End (org.camunda.bpm.engine.test.standalone.pvm.activities.End)30 WaitState (org.camunda.bpm.engine.test.standalone.pvm.activities.WaitState)20 EmbeddedSubProcess (org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess)18 ParallelGateway (org.camunda.bpm.engine.test.standalone.pvm.activities.ParallelGateway)12 ArrayList (java.util.ArrayList)9 PvmExecution (org.camunda.bpm.engine.impl.pvm.PvmExecution)9 ExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl)3 ProcessDefinitionImpl (org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)2 PvmExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl)2 EventScopeCreatingSubprocess (org.camunda.bpm.engine.test.standalone.pvm.activities.EventScopeCreatingSubprocess)2 While (org.camunda.bpm.engine.test.standalone.pvm.activities.While)2 FoxDeleteProcessInstanceCmd (org.camunda.bpm.engine.impl.cmd.FoxDeleteProcessInstanceCmd)1 Decision (org.camunda.bpm.engine.test.standalone.pvm.activities.Decision)1 ReusableSubProcess (org.camunda.bpm.engine.test.standalone.pvm.activities.ReusableSubProcess)1 TransitionInstanceVerifyer (org.camunda.bpm.engine.test.standalone.pvm.verification.TransitionInstanceVerifyer)1