ProcessDefinition processDefinition = this.zebraDefinitionFactory
ZebraProcessDefinition processDefinition = this.zebraDefinitionFactory
	public void testSimpleWorkflow() {		ProcessDefinition processDefinition = this.zebraDefinitionFactory				.getAllProcessDefinitionsByName().get(SIMPLEWORKFLOW);		assertNotNull(processDefinition);		assertEquals(SIMPLEWORKFLOW, processDefinition.getName());		assertTrue(processDefinition.getTaskDefinitions().size() == 5);		TaskDefinition task = (TaskDefinition) processDefinition.getFirstTask();		assertEquals(WELCOME_TO_WORKFLOW, task.getName());		Iterator router = task.getRoutingOut().iterator();		RoutingDefinition route = (RoutingDefinition) router.next();		task = (TaskDefinition) route.getDestinationTaskDefinition();		assertEquals(ENTER_SOME_DATA, task.getName());		router = task.getRoutingOut().iterator();		route = (RoutingDefinition) router.next();		task = (TaskDefinition) route.getDestinationTaskDefinition();		assertEquals(DO_YOU_WANT_TO_TRY_AND_SUBPROCESS_, task.getName());		boolean foundIT = false;		TaskDefinition subProcess = null;		router = task.getRoutingOut().iterator();		while (router.hasNext()) {			route = (RoutingDefinition) router.next();			task = (TaskDefinition) route.getDestinationTaskDefinition();			if (task.getName().compareTo(SUBPROCESS) == 0) {				foundIT = true;				subProcess = task;			}		}		assertTrue(DIDN_T_FIND_SUBPROCESS, foundIT);		router = subProcess.getRoutingOut().iterator();		// this one will loop		route = (RoutingDefinition) router.next();		task = (TaskDefinition) route.getDestinationTaskDefinition();		assertEquals(THE_END, task.getName());		// check back up the line		foundIT = false;		TaskDefinition subprocess = null;		router = task.getRoutingIn().iterator();		while (router.hasNext()) {			route = (RoutingDefinition) router.next();			task = (TaskDefinition) route.getOriginatingTaskDefinition();			if (task.getName().compareTo(DO_YOU_WANT_TO_TRY_AND_SUBPROCESS_) == 0) {				foundIT = true;				subprocess = task;			}		}		assertNotNull(subprocess);		assertTrue(DIDN_T_FIND_DO_YOU_WANT_TO_TRY_AND_SUBPROCESS_, foundIT);	}