Search in sources :

Example 1 with ReusableSubProcess

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

the class PvmReusableSubProcessTest method testReusableSubProcess.

public void testReusableSubProcess() {
    PvmProcessDefinition subProcessDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("subEnd").endActivity().createActivity("subEnd").behavior(new End()).endActivity().buildProcessDefinition();
    PvmProcessDefinition superProcessDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).transition("subprocess").endActivity().createActivity("subprocess").behavior(new ReusableSubProcess(subProcessDefinition)).transition("superEnd").endActivity().createActivity("superEnd").behavior(new End()).endActivity().buildProcessDefinition();
    PvmProcessInstance processInstance = superProcessDefinition.createProcessInstance();
    processInstance.start();
    assertTrue(processInstance.isEnded());
}
Also used : PvmProcessInstance(org.camunda.bpm.engine.impl.pvm.PvmProcessInstance) 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) ReusableSubProcess(org.camunda.bpm.engine.test.standalone.pvm.activities.ReusableSubProcess) Automatic(org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)

Aggregations

ProcessDefinitionBuilder (org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder)1 PvmProcessDefinition (org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition)1 PvmProcessInstance (org.camunda.bpm.engine.impl.pvm.PvmProcessInstance)1 Automatic (org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)1 End (org.camunda.bpm.engine.test.standalone.pvm.activities.End)1 ReusableSubProcess (org.camunda.bpm.engine.test.standalone.pvm.activities.ReusableSubProcess)1