RuleBase ruleBase = readDynamicSubProcess();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
Map<String, Object> params = new HashMap<String, Object>();
params.put("x", "subflow");
ProcessInstance processInstance = ( ProcessInstance )
workingMemory.startProcess("com.sample.ruleflow", params);
assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
assertEquals(2, workingMemory.getProcessInstances().size());
workingMemory.insert(new Person());
assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
assertEquals(0, workingMemory.getProcessInstances().size());