ti.setConditionAction(ComplexProcessDef.GOTO + pd.tdAlternateEnding.getName()); engine.transitionTask(ti);
engine.transitionTask(tiJoin);
	public void testAlternateEnding() throws Exception {				ComplexProcessDef pd = new ComplexProcessDef("complexTest1");						MockStateFactory msf = new MockStateFactory();		IEngine engine = new Engine(msf);		MockProcessInstance processInstance = (MockProcessInstance) engine.createProcess(pd);		// first transition test - runs the workflow up to the point where it hits the JOIN		doPart1(pd, engine, processInstance);				/*		 * now transition the workflow toward the alternate ending		 */		MockTaskInstance ti = processInstance.findTask(pd.tdParallel_2,MockTaskInstance.STATE_READY);		assertNotNull("Failed to find the task to run",ti);				ti.setConditionAction(ComplexProcessDef.GOTO + pd.tdAlternateEnding.getName());		engine.transitionTask(ti);				/*		 * check to see if we have the expected number of object in the audit trail		 * 1 x process		 * 1 x tdStart (complete)		 * 1 x tdSplit (complete)		 * 1 x tdJoin (complete)		 * 1 x tdParallel-1 (complete)		 * 1 x tdParallel-2 (complete)		 * 1 x tdAlternateEnding (ready)		 * 1 x tdEnd (ready)		 */		assertEquals(8,msf.getAuditTrail().size());		assertEquals(1,msf.countInstances(pd));		assertEquals(1,msf.countInstances(pd.tdStart, MockTaskInstance.STATE_DELETED));		assertEquals(1,msf.countInstances(pd.tdSplit, MockTaskInstance.STATE_DELETED));		assertEquals(1,msf.countInstances(pd.tdJoin, MockTaskInstance.STATE_DELETED));		assertEquals(1,msf.countInstances(pd.tdParallel_1, MockTaskInstance.STATE_DELETED));		assertEquals(1,msf.countInstances(pd.tdParallel_2, MockTaskInstance.STATE_DELETED));		assertEquals(1,msf.countInstances(pd.tdEnd, MockTaskInstance.STATE_READY));		assertEquals(1,msf.countInstances(pd.tdAlternateEnding, MockTaskInstance.STATE_READY));	}