.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();