ProcessInstance processInstance = new ProcessInstance(processDefinition);
Token token = processInstance.getRootToken();
processInstance.signal();
// check the transition log (from the start state to the state)
LoggingInstance loggingInstance = processInstance.getLoggingInstance();
List transitionLogs = loggingInstance.getLogs(TransitionLog.class);
assertEquals(1, transitionLogs.size());
TransitionLog transitionLog = (TransitionLog) transitionLogs.get(0);
assertSame(token, transitionLog.getToken());
assertNotNull(transitionLog.getDate());
assertSame(processDefinition.getStartState(), transitionLog.getSourceNode());
assertSame(processDefinition.getNode("state"), transitionLog.getDestinationNode());
// signal the process to continue (which will move it to the end state)
processInstance.signal();
// check the transition log (from the state to the end state)
transitionLogs = loggingInstance.getLogs(TransitionLog.class);
assertEquals(2, transitionLogs.size());
transitionLog = (TransitionLog) transitionLogs.get(1);
assertSame(token, transitionLog.getToken());
assertNotNull(transitionLog.getDate());
assertSame(processDefinition.getNode("state"), transitionLog.getSourceNode());