MockTaskInstance ti = (MockTaskInstance) taskInstances.iterator().next(); assertEquals(pd.tdStart, ti.getTaskDefinition()); log.info("Transitioning Task " + ti.getTaskInstanceId()); engine.transitionTask(ti);
tiStart = (MockTaskInstance) taskInstances.iterator().next(); assertEquals(pd.tdStart, tiStart.getTaskDefinition()); engine.transitionTask(tiStart);
	private void doPart1(ComplexProcessDef pd, IEngine engine, MockProcessInstance processInstance) throws DefinitionNotFoundException, StartProcessException, TransitionException {		// tests to see if process is created properly 		assertEquals(pd, processInstance.getProcessDef());		assertTrue(processInstance.getProcessInstanceId().longValue() > 0);		assertEquals(IProcessInstance.STATE_CREATED, processInstance.getState());		// test to see if we have the expected number of tasks - NONE		Set taskInstances = processInstance.getTaskInstances();		assertEquals(0, taskInstances.size());		log.info("Starting Process");		engine.startProcess(processInstance);		taskInstances = processInstance.getTaskInstances();		// test to see if we have the expected number of tasks - ONE		assertEquals(1, taskInstances.size());				MockTaskInstance ti = (MockTaskInstance) taskInstances.iterator().next();		assertEquals(pd.tdStart, ti.getTaskDefinition());		log.info("Transitioning Task " + ti.getTaskInstanceId());		engine.transitionTask(ti);				/* ensure the tasks are the ones we expect		 * 1 x tdJoin		 * 1 x tdParallel2		 */		assertEquals(2,processInstance.getTaskInstances().size());		assertEquals(1,processInstance.countInstances(pd.tdParallel_2,MockTaskInstance.STATE_READY));		assertEquals(1,processInstance.countInstances(pd.tdJoin,MockTaskInstance.STATE_AWAITINGSYNC));	}