Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.FlowExecution.start()


      }
    }));
    FlowExecution execution = factory.createFlowExecution(flow);
    FormAction action = (FormAction) flow.getApplicationContext().getBean("formAction");
    assertFalse(((TestBeanValidator) action.getValidator()).getInvoked());
    execution.start(null, new MockExternalContext());
    MockExternalContext context = new MockExternalContext();
    context.setEventId("submit");
    execution.resume(context);
    assertTrue(((TestBeanValidator) action.getValidator()).getInvoked());
  }
View Full Code Here


            new SimpleFlowExecutionSnapshotFactory(executionFactory, newMockFlowLocator(flow)));
        keyFactory.setAlwaysGenerateNewNextKey(true);
        executionFactory.setExecutionKeyFactory(keyFactory);
        final FlowExecution execution = executionFactory.createFlowExecution(flow);

        execution.start(null, new MockExternalContext());

        // Flow state: rendered subflow view
        assertTrue(execution.isActive());
        assertEquals("view", execution.getActiveSession().getScope().get("renderCalled"));
        final FlowExecutionKey key1 = execution.getKey();
View Full Code Here

        logger.debug("Launching new execution of flow '" + flowId + "' with input " + input);
      }
      ExternalContextHolder.setExternalContext(context);
      FlowDefinition flowDefinition = definitionLocator.getFlowDefinition(flowId);
      FlowExecution flowExecution = executionFactory.createFlowExecution(flowDefinition);
      flowExecution.start(input, context);
      if (!flowExecution.hasEnded()) {
        executionRepository.putFlowExecution(flowExecution);
        return createPausedResult(flowExecution);
      } else {
        return createEndResult(flowExecution);
View Full Code Here

      }
    };
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue("Should have ended", !execution.isActive());
  }

  public void testStateExceptionHandlingTransitionNoSuchState() {
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
View Full Code Here

    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have failed no such state");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

  }

  public void testStateExceptionHandlingRethrow() {
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have rethrown");
    } catch (FlowExecutionException e) {
      // expected
    }
  }
View Full Code Here

        return Flow.create(getContext().getFlowId(), getContext().getFlowAttributes());
      }
    };
    Flow flow = new FlowAssembler(builder, new MockFlowBuilderContext("flow")).assembleFlow();
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue(execution.isActive());
  }

  protected TargetStateResolver toState(String stateId) {
    return new DefaultTargetStateResolver(stateId);
View Full Code Here

      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertFalse(execution.isActive());
    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }

  public void testCreateWithExecutionKeyFactory() {
    State state = new State(flowDefinition, "state") {
View Full Code Here

      }
    };
    flowDefinition.setStartState(state);
    factory.setExecutionKeyFactory(new MockFlowExecutionKeyFactory());
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    execution.start(null, new MockExternalContext());
    assertTrue(getKeyCalled);
    assertTrue(removeAllSnapshotsCalled);
    assertTrue(removeSnapshotCalled);
    assertTrue(updateSnapshotCalled);
    assertNull(execution.getKey());
View Full Code Here

    }
  }

  public void testPutFlowExecution() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    String key = execution.getKey().toString();
    FlowExecutionKey parsedKey = repository.parseFlowExecutionKey(key);
    FlowExecution execution2 = repository.getFlowExecution(parsedKey);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.