Package org.springframework.webflow.engine.impl

Examples of org.springframework.webflow.engine.impl.FlowExecutionImplFactory


    } catch (IllegalArgumentException e) {
    }
  }

  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


      public Flow createFlow() throws FlowBuilderException {
        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());
  }
View Full Code Here

    notReached.setOutputs(asList(OutputModel.class, new OutputModel("notReached", "flowScope.foo")));

    model.setStates(asList(AbstractStateModel.class, end, notReached));

    Flow flow = getFlow(model);
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    FlowExecution execution = factory.createFlowExecution(flow);
    MockExternalContext context = new MockExternalContext();
    MutableAttributeMap<Object> map = new LocalAttributeMap<Object>();
    map.put("foo", "bar");
    map.put("number", "3");
    map.put("required", "9");
View Full Code Here

      public FlowDefinition getFlowDefinition(String flowId) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        return flow;
      }
    };
    executionFactory = new FlowExecutionImplFactory();
    executionFactory.setExecutionKeyFactory(executionKeyFactory);
    factory = new SerializedFlowExecutionSnapshotFactory(executionFactory, locator);
  }
View Full Code Here

    XmlFlowModelBuilder builder = new XmlFlowModelBuilder(resource, registry);
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
    FlowModelFlowBuilder flowBuilder = new FlowModelFlowBuilder(holder);
    FlowAssembler assembler = new FlowAssembler(flowBuilder, new MockFlowBuilderContext("flow"));
    Flow flow = assembler.assembleFlow();
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(new FlowExecutionListenerAdapter() {
      public void viewRendering(RequestContext context, View view, StateDefinition viewState) {
        if (context.getCurrentEvent() != null && context.getCurrentEvent().getId().equals("submit")) {
          BindingResult result = (BindingResult) context.getFlashScope().get(
              "org.springframework.validation.BindingResult.formBean");
          assertEquals(1, result.getErrorCount());
        }
      }

      public void viewRendered(RequestContext context, View view, StateDefinition viewState) {
        if (context.getCurrentEvent() != null && context.getCurrentEvent().getId().equals("submit")) {
          BindingResult result = (BindingResult) context.getFlashScope().get(
              "org.springframework.validation.BindingResult.formBean");
          assertNull(result);
        }
      }
    }));
    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");
View Full Code Here

    Object assertCountAction = assertCountAction();
    context.registerBean("assertCountAction", assertCountAction);
    childFlowContext.registerBean("assertCountAction", assertCountAction);

    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(persistenceListener));
    flowExecution = factory.createFlowExecution(rootFlow);
  }
View Full Code Here

   * flow execution factory or custom configuration of the flow execution factory, registering flow execution
   * listeners for instance. The default implementation just returns a {@link FlowExecutionImplFactory} instance.
   * @return the flow execution factory
   */
  protected FlowExecutionFactory createFlowExecutionFactory() {
    return new FlowExecutionImplFactory();
  }
View Full Code Here

    Assert.notNull(flowDefinitionLocator, "The flow definition locator property is required");
    if (conversionService == null) {
      conversionService = new DefaultConversionService();
    }
    MutableAttributeMap<Object> executionAttributes = createFlowExecutionAttributes();
    FlowExecutionImplFactory executionFactory = createFlowExecutionFactory(executionAttributes);
    DefaultFlowExecutionRepository executionRepository = createFlowExecutionRepository(executionFactory);
    executionFactory.setExecutionKeyFactory(executionRepository);
    flowExecutor = new FlowExecutorImpl(flowDefinitionLocator, executionFactory, executionRepository);
  }
View Full Code Here

      return new SerializedFlowExecutionSnapshotFactory(executionFactory, flowDefinitionLocator);
    }
  }

  private FlowExecutionImplFactory createFlowExecutionFactory(AttributeMap<Object> executionAttributes) {
    FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory();
    executionFactory.setExecutionAttributes(executionAttributes);
    if (flowExecutionListenerLoader != null) {
      executionFactory.setExecutionListenerLoader(flowExecutionListenerLoader);
    }
    return executionFactory;
  }
View Full Code Here

  /**
   * Create and return a {@link FlowExecutor} instance.
   */
  public FlowExecutor build() {
    FlowExecutionImplFactory executionFactory = getExecutionFactory();
    DefaultFlowExecutionRepository executionRepository = getFlowExecutionRepository(executionFactory);
    executionFactory.setExecutionKeyFactory(executionRepository);
    return new FlowExecutorImpl(this.flowRegistry, executionFactory, executionRepository);
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.impl.FlowExecutionImplFactory

Copyright © 2018 www.massapicom. 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.