use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance 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());
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance 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());
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance 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());
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance 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());
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance 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());
}
Aggregations