Search in sources :

Example 1 with ReusableSubProcess

use of org.activiti.engine.test.pvm.activities.ReusableSubProcess in project Activiti by Activiti.

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.activiti.engine.impl.pvm.PvmProcessInstance) PvmProcessDefinition(org.activiti.engine.impl.pvm.PvmProcessDefinition) End(org.activiti.engine.test.pvm.activities.End) ProcessDefinitionBuilder(org.activiti.engine.impl.pvm.ProcessDefinitionBuilder) ReusableSubProcess(org.activiti.engine.test.pvm.activities.ReusableSubProcess) Automatic(org.activiti.engine.test.pvm.activities.Automatic)

Aggregations

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