/** * Returns a flag indicating if this state is the start state of its owning flow. * @return true if the flow is the start state, false otherwise */ public boolean isStartState() { return flow.getStartState() == this; }
/** * Returns a flag indicating if this state is the start state of its owning flow. * @return true if the flow is the start state, false otherwise */ public boolean isStartState() { return flow.getStartState() == this; }
/** * Returns a flag indicating if this state is the start state of its owning flow. * @return true if the flow is the start state, false otherwise */ public boolean isStartState() { return flow.getStartState() == this; }
@Override public TransitionableState getStartState(final Flow flow) { return (TransitionableState) flow.getStartState(); }
/** * Returns a flag indicating if this state is the start state of its owning flow. * @return true if the flow is the start state, false otherwise */ public boolean isStartState() { return flow.getStartState() == this; }
/** * Gets start state. * * @param flow the flow * @return the start state */ protected TransitionableState getStartState(final Flow flow) { final TransitionableState currentStartState = TransitionableState.class.cast(flow.getStartState()); return currentStartState; }
public void testGetStateNoStartState() { Flow flow = new Flow("myFlow"); try { flow.getStartState(); fail("Retrieved start state when no such state"); } catch (IllegalStateException e) { // expected } }
val flowDetails = new LinkedHashMap<String, Object>(); val def = Flow.class.cast(v.getFlowDefinition(id)); flowDetails.put("startState", def.getStartState().getId());
addTransitionToActionState(actionState, flowId, flowId); final TransitionableState currentStartState = TransitionableState.class.cast(flow.getStartState()); LOGGER.debug("Replaced flow {} start state with {}", flow.getId(), flow.getStartState().getId()); } catch (final Exception e) { LOGGER.error(e.getMessage(), e);
public ViewSelection start(Flow flow, MutableAttributeMap input) throws FlowExecutionException { if (input == null) { // create a mutable map so entries can be added by listeners! input = new LocalAttributeMap(); } if (logger.isDebugEnabled()) { logger.debug("Activating new session for flow '" + flow.getId() + "' in state '" + flow.getStartState().getId() + "' with input " + input); } getExecutionListeners().fireSessionStarting(this, flow, input); FlowSession session = flowExecution.activateSession(flow); getExecutionListeners().fireSessionCreated(this, session); ViewSelection selectedView = flow.start(this, input); getExecutionListeners().fireSessionStarted(this, session); return selectedView; }
public void testResourceBackedFlowBuilder() { ClassPathResource resource = new ClassPathResource("flow-endstate.xml", XmlFlowModelBuilderTests.class); Flow flow = getFlow(resource); assertEquals("flow", flow.getId()); assertEquals("end", flow.getStartState().getId()); }
val initStartState = (ActionState) mfaFlow.getStartState(); val transition = (Transition) initStartState.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS); val targetStateId = transition.getTargetStateId(); val startState = flow.getTransitionableState(flow.getStartState().getId()); createTransitionForState(startState, subflowId, subflowId); });
public void testHandleExceptionNoMatch() { MockRequestControlContext context = new MockRequestControlContext(flow); FlowExecutionException e = new FlowExecutionException(flow.getId(), flow.getStartState().getId(), "Oops!", new TestException()); try { flow.handleException(e, context); } catch (FlowExecutionException ex) { // expected } }
public void testBuildFlowWithEndState() { model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); assertEquals("flow", flow.getId()); assertEquals("end", flow.getStartState().getId()); }
public void testBuildFlowWithDefaultStartState() { model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); assertEquals("flow", flow.getId()); assertEquals("end", flow.getStartState().getId()); }
public void testBuildFlowWithStartStateAttribute() { model.setStartStateId("end"); model.setStates(asList(new EndStateModel("foo"), new EndStateModel("end"))); Flow flow = getFlow(model); assertEquals("flow", flow.getId()); assertEquals("end", flow.getStartState().getId()); }
public void testHandleException() { flow.getExceptionHandlerSet().add( new TransitionExecutingFlowExecutionExceptionHandler().add(TestException.class, "myState2")); MockRequestControlContext context = new MockRequestControlContext(flow); context.setCurrentState(flow.getStateInstance("myState1")); FlowExecutionException e = new FlowExecutionException(flow.getId(), flow.getStartState().getId(), "Oops!", new TestException()); flow.handleException(e, context); assertFalse(context.getFlowExecutionContext().isActive()); }
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()); }