use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.
the class PvmActivityInstanceTest method testNestedSubProcessNoEnd.
/**
* +-------------------------------------------------------+
* | embedded subprocess |
* | +--------------------------------+ |
* | | nested embedded subprocess | |
* +-----+ | +-----------+ | +-----------+ +---------+ | | +---+
* |start|-->| |startInside|--> | |startInside|-->|endInside| | |-->|end|
* +-----+ | +-----------+ | +-----------+ +---------+ | | +---+
* | +--------------------------------+ |
* | |
* +-------------------------------------------------------+
*/
public void testNestedSubProcessNoEnd() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).createActivity("startInside").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("nestedSubProcess").endActivity().createActivity("nestedSubProcess").scope().behavior(new EmbeddedSubProcess()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).createActivity("startNestedInside").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("endInside").endActivity().createActivity("endInside").behavior(new End()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().endActivity().transition("end").endActivity().createActivity("end").behavior(new End()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().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);
verifier.assertStartInstanceCount(1, "startInside");
verifier.assertParent("startInside", "embeddedsubprocess");
verifier.assertStartInstanceCount(1, "nestedSubProcess");
verifier.assertParent("nestedSubProcess", "embeddedsubprocess");
verifier.assertStartInstanceCount(1, "startNestedInside");
verifier.assertParent("startNestedInside", "nestedSubProcess");
verifier.assertStartInstanceCount(1, "endInside");
verifier.assertParent("endInside", "nestedSubProcess");
verifier.assertStartInstanceCount(1, "end");
verifier.assertProcessInstanceParent("end", processInstance);
}
use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.
the class PvmActivityInstanceTest method testSubProcessNoEnd.
public void testSubProcessNoEnd() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).createActivity("startInside").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().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);
verifier.assertStartInstanceCount(1, "startInside");
verifier.assertStartInstanceCount(1, "startInside");
}
use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.
the class PvmActivityInstanceTest method testNestedSubProcessBothNoEnd.
/**
* +-------------------------------------------------------+
* | embedded subprocess |
* | +--------------------------------+ |
* | | nested embedded subprocess | |
* +-----+ | +-----------+ | +-----------+ | |
* |start|-->| |startInside|--> | |startInside| | |
* +-----+ | +-----------+ | +-----------+ | |
* | +--------------------------------+ |
* | |
* +-------------------------------------------------------+
*/
public void testNestedSubProcessBothNoEnd() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).createActivity("startInside").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("nestedSubProcess").endActivity().createActivity("nestedSubProcess").scope().behavior(new EmbeddedSubProcess()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).createActivity("startNestedInside").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().endActivity().endActivity().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);
verifier.assertStartInstanceCount(1, "startInside");
verifier.assertParent("startInside", "embeddedsubprocess");
verifier.assertStartInstanceCount(1, "nestedSubProcess");
verifier.assertParent("nestedSubProcess", "embeddedsubprocess");
verifier.assertStartInstanceCount(1, "startNestedInside");
verifier.assertParent("startNestedInside", "nestedSubProcess");
}
use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.
the class PvmActivityInstanceTest method testSequence.
/**
* +-----+ +-----+ +-------+
* | one |-->| two |-->| three |
* +-----+ +-----+ +-------+
*/
public void testSequence() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("one").initial().behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("two").endActivity().createActivity("two").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("three").endActivity().createActivity("three").behavior(new End()).executionListener(ExecutionListener.EVENTNAME_START, verifier).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
verifier.assertStartInstanceCount(1, "one");
verifier.assertStartInstanceCount(1, "two");
verifier.assertStartInstanceCount(1, "three");
}
use of org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic in project camunda-bpm-platform by camunda.
the class PvmEmbeddedSubProcessTest method testMultipleConcurrentEndsInsideEmbeddedSubProcessWithWaitState.
/**
* +-------------------------------------------------+
* | embeddedsubprocess +----------+ |
* | +---->|endInside1| |
* | | +----------+ |
* | | |
* +-----+ | +-----------+ +----+ +----+ +----------+ | +---+
* |start|-->| |startInside|-->|fork|-->|wait|-->|endInside2| |-->|end|
* +-----+ | +-----------+ +----+ +----+ +----------+ | +---+
* | | |
* | | +----------+ |
* | +---->|endInside3| |
* | +----------+ |
* +-------------------------------------------------+
*/
public void testMultipleConcurrentEndsInsideEmbeddedSubProcessWithWaitState() {
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("wait").transition("endInside3").endActivity().createActivity("endInside1").behavior(new End()).endActivity().createActivity("wait").behavior(new WaitState()).transition("endInside2").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();
assertFalse(processInstance.isEnded());
PvmExecution execution = processInstance.findExecution("wait");
execution.signal(null, null);
assertTrue(processInstance.isEnded());
}
Aggregations