Package org.springframework.webflow.engine.model.builder

Examples of org.springframework.webflow.engine.model.builder.DefaultFlowModelHolder


  public void testStateMergeParentStateIncompatable() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-state-child-alt.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-state-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent,
        registry)));
    try {
      registry.getFlowModel("child");
      fail("A FlowModelBuilderException was expected");
    } catch (FlowModelBuilderException e) {
View Full Code Here


  }

  public void testParseFlowExceptionHandler() {
    ClassPathResource res = new ClassPathResource("flow-exception-handler.xml", getClass());
    XmlFlowModelBuilder builder = new XmlFlowModelBuilder(res);
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
    FlowModel model = holder.getFlowModel();
    assertEquals("foo1", ((ExceptionHandlerModel) model.getExceptionHandlers().get(0)).getBean());
    assertEquals("foo2", ((ExceptionHandlerModel) model.getStateById("state1").getExceptionHandlers().get(0))
        .getBean());
    assertEquals("foo3", ((ExceptionHandlerModel) model.getStateById("state2").getExceptionHandlers().get(0))
        .getBean());
View Full Code Here

  }

  public void testFormActionValidatorMethod() {
    ClassPathResource resource = new ClassPathResource("flow-formaction-validatormethod.xml", getClass());
    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() {
View Full Code Here

  }

  protected final FlowBuilder createFlowBuilder(FlowDefinitionResource resource) {
    registerDependentFlowModels();
    FlowModelBuilder modelBuilder = new XmlFlowModelBuilder(resource.getPath(), flowModelRegistry);
    FlowModelHolder modelHolder = new DefaultFlowModelHolder(modelBuilder);
    flowModelRegistry.registerFlowModel(resource.getId(), modelHolder);
    return new FlowModelFlowBuilder(modelHolder) {
      protected void registerFlowBeans(ConfigurableBeanFactory flowBeanFactory) {
        registerMockFlowBeans(flowBeanFactory);
      }
View Full Code Here

    FlowDefinitionResource[] modelResources = getModelResources(getResourceFactory());
    if (modelResources != null) {
      for (int i = 0; i < modelResources.length; i++) {
        FlowDefinitionResource modelResource = modelResources[i];
        FlowModelBuilder modelBuilder = new XmlFlowModelBuilder(modelResource.getPath(), flowModelRegistry);
        flowModelRegistry.registerFlowModel(modelResource.getId(), new DefaultFlowModelHolder(modelBuilder));
      }
    }
  }
View Full Code Here

  private FlowBuilder createFlowBuilder(FlowDefinitionResource resource) {
    return new FlowModelFlowBuilder(createFlowModelHolder(resource));
  }

  private FlowModelHolder createFlowModelHolder(FlowDefinitionResource resource) {
    FlowModelHolder modelHolder = new DefaultFlowModelHolder(createFlowModelBuilder(resource));
    // register the flow model holder with the backing flow model registry - this is needed to support flow model
    // merging during the flow build process
    flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), modelHolder);
    return modelHolder;
  }
View Full Code Here

    FlowAssembler assembler = new FlowAssembler(builder, new MockFlowBuilderContext("flow"));
    return assembler.assembleFlow();
  }

  private Flow getFlow(ClassPathResource resource) {
    FlowModelHolder holder = new DefaultFlowModelHolder(new XmlFlowModelBuilder(resource,
        new FlowModelRegistryImpl()));
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(holder);
    FlowAssembler assembler = new FlowAssembler(builder, new MockFlowBuilderContext("flow"));
    return assembler.assembleFlow();
  }
View Full Code Here

    initDataSource();
    populateDataBase();
    persistenceListener = createFlowExecutionListener();

    ClassPathResource resource = new ClassPathResource("managed-root-flow.xml", getClass());
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(new XmlFlowModelBuilder(resource));
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(holder);
    MockFlowBuilderContext context = new MockFlowBuilderContext("managed-root-flow");
    FlowAssembler assembler = new FlowAssembler(builder, context);
    Flow rootFlow = assembler.assembleFlow();

    ClassPathResource childFlowResource = new ClassPathResource("managed-child-flow.xml", getClass());
    DefaultFlowModelHolder childFlowHolder = new DefaultFlowModelHolder(new XmlFlowModelBuilder(childFlowResource));
    FlowModelFlowBuilder childFlowBuilder = new FlowModelFlowBuilder(childFlowHolder);
    MockFlowBuilderContext childFlowContext = new MockFlowBuilderContext("managed-child-flow");
    FlowAssembler childFlowAssembler = new FlowAssembler(childFlowBuilder, childFlowContext);
    Flow childFlow = childFlowAssembler.assembleFlow();
View Full Code Here

  public void testMerge() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-child.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent,
        registry)));
    FlowModel flow = registry.getFlowModel("child");
    assertEquals(1, flow.getGlobalTransitions().size());
    assertEquals(2, flow.getStates().size());
    assertEquals("view", flow.getStates().get(0).getId());
View Full Code Here

  public void testMergeParentNotFound() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-child.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent-id-not-matching", new DefaultFlowModelHolder(new XmlFlowModelBuilder(
        resourceParent, registry)));
    try {
      registry.getFlowModel("child");
      fail("A FlowModelBuilderException was expected");
    } catch (FlowModelBuilderException e) {
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.model.builder.DefaultFlowModelHolder

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.