TransitionInstanceVerifyer transitionVerifier = new TransitionInstanceVerifyer();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.startTransition("loop")
.executionListener(ExecutionListener.EVENTNAME_TAKE, transitionVerifier)
.endTransition()
.endActivity()
.createActivity("loop")
.behavior(new While("count", 0, 10))
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.startTransition("one", "more")
.executionListener(ExecutionListener.EVENTNAME_TAKE, transitionVerifier)
.endTransition()
.startTransition("end", "done")
.executionListener(ExecutionListener.EVENTNAME_TAKE, transitionVerifier)
.endTransition()
.endActivity()
.createActivity("one")
.behavior(new Automatic())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("two")
.endActivity()
.createActivity("two")
.behavior(new Automatic())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("three")
.endActivity()
.createActivity("three")
.behavior(new Automatic())
.executionListener(ExecutionListener.EVENTNAME_START, verifier)
.executionListener(ExecutionListener.EVENTNAME_END, verifier)
.transition("loop")
.endActivity()
.createActivity("end")