/** * Convenience accessor that returns an ordered array of the String <code>ids</code> for the state definitions * associated with this flow definition. * @return the state ids */ public String[] getStateIds() { String[] stateIds = new String[getStateCount()]; int i = 0; for (State state : states) { stateIds[i++] = state.getId(); } return stateIds; }
/** * Convenience accessor that returns an ordered array of the String <code>ids</code> for the state definitions * associated with this flow definition. * @return the state ids */ public String[] getStateIds() { String[] stateIds = new String[getStateCount()]; int i = 0; for (State state : states) { stateIds[i++] = state.getId(); } return stateIds; }
/** * Convenience accessor that returns an ordered array of the String <code>ids</code> for the state definitions * associated with this flow definition. * @return the state ids */ public String[] getStateIds() { String[] stateIds = new String[getStateCount()]; int i = 0; Iterator it = states.iterator(); while (it.hasNext()) { stateIds[i++] = ((State) it.next()).getId(); } return stateIds; }
/** * Convenience accessor that returns an ordered array of the String <code>ids</code> for the state definitions * associated with this flow definition. * @return the state ids */ public String[] getStateIds() { String[] stateIds = new String[getStateCount()]; int i = 0; Iterator it = states.iterator(); while (it.hasNext()) { stateIds[i++] = ((State) it.next()).getId(); } return stateIds; }
flowDetails.put("states", states); flowDetails.put("possibleOutcomes", def.getPossibleOutcomes()); flowDetails.put("stateCount", def.getStateCount());
public void testAddSameStateTwice() { Flow flow = new Flow("myFlow"); EndState state = new EndState(flow, "myState1"); try { flow.add(state); fail("Should have failed"); } catch (IllegalArgumentException e) { } assertEquals("State count wrong:", 1, flow.getStateCount()); }
public void testAddStates() { Flow flow = new Flow("myFlow"); new EndState(flow, "myState1"); new EndState(flow, "myState2"); assertEquals("Wrong start state:", "myState1", flow.getStartState().getId()); assertEquals("State count wrong:", 2, flow.getStateCount()); assertTrue(flow.containsState("myState1")); assertTrue(flow.containsState("myState2")); State state = flow.getStateInstance("myState1"); assertEquals("Wrong flow:", flow.getId(), state.getFlow().getId()); assertEquals("Wrong state:", "myState1", flow.getState("myState1").getId()); assertEquals("Wrong state:", "myState2", flow.getState("myState2").getId()); }