.endActivity()
.endActivity()
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
List<String> expectedEvents = new ArrayList<String>();
expectedEvents.add("start on ProcessDefinition(scopes and events)");
expectedEvents.add("start on Activity(mostOuterNestedActivity)");
expectedEvents.add("start on Activity(outerScope)");
expectedEvents.add("start on Activity(firstInnerScope)");
expectedEvents.add("start on Activity(firstMostInnerNestedActivity)");
expectedEvents.add("start on Activity(start)");
expectedEvents.add("end on Activity(start)");
expectedEvents.add("start on Activity(waitInFirst)");
assertEquals("expected "+expectedEvents+", but was \n"+eventCollector+"\n", expectedEvents, eventCollector.events);
eventCollector.events.clear();
PvmExecution execution = processInstance.findExecution("waitInFirst");
execution.signal(null, null);
expectedEvents = new ArrayList<String>();
expectedEvents.add("end on Activity(waitInFirst)");
expectedEvents.add("end on Activity(firstMostInnerNestedActivity)");
expectedEvents.add("end on Activity(firstInnerScope)");
expectedEvents.add("start on Activity(secondInnerScope)");
expectedEvents.add("start on Activity(secondMostInnerNestedActivity)");
expectedEvents.add("start on Activity(waitInSecond)");
assertEquals("expected "+expectedEvents+", but was \n"+eventCollector+"\n", expectedEvents, eventCollector.events);
eventCollector.events.clear();
execution = processInstance.findExecution("waitInSecond");
execution.signal(null, null);
expectedEvents = new ArrayList<String>();
expectedEvents.add("end on Activity(waitInSecond)");
expectedEvents.add("start on Activity(end)");