public void testTransition() { Condition condition = new IsTrue().left(new Binding().expression("testsPassed")); ExecutableWorkflow workflow = new ExecutableWorkflow() .activity("start", new StartEvent()) .activity("smokeTest", new NoneTask()) .activity("checkTestResult", new ExclusiveGateway().defaultTransitionId("to-failed")) .activity("passed", new EndEvent()) .activity("failed", new EndEvent()) .transition("to-smokeTest", new Transition().fromId("start").toId("smokeTest").description("Starting the process")) .transition("to-checkTestResult", new Transition().fromId("smokeTest").toId("checkTestResult")) .transition("to-passed", new Transition().fromId("checkTestResult").toId("passed").condition(condition)) .transition("to-failed", new Transition().fromId("checkTestResult").toId("failed")); workflow = serialize(workflow); assertEquals(4, workflow.getTransitions().size()); assertEquals("to-smokeTest", workflow.getTransitions().get(0).getId()); assertEquals("Starting the process", workflow.getTransitions().get(0).getDescription()); assertEquals("start", workflow.getTransitions().get(0).getFromId()); assertEquals("smokeTest", workflow.getTransitions().get(0).getToId()); assertEquals("to-passed", workflow.getTransitions().get(2).getId()); IsTrue deserialisedCondition = (IsTrue) workflow.getTransitions().get(2).getCondition(); assertEquals("testsPassed", deserialisedCondition.getLeft().getExpression()); }