Package org.springframework.webflow.engine.builder

Examples of org.springframework.webflow.engine.builder.FlowAssembler


      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


      }
    };
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(new StaticFlowModelHolder(model));
    MockFlowBuilderContext context = new MockFlowBuilderContext("foo");
    context.registerBean("exceptionHandler", handler);
    FlowAssembler assembler = new FlowAssembler(builder, context);
    Flow flow = assembler.assembleFlow();
    assertEquals(1, flow.getExceptionHandlerSet().size());
  }
View Full Code Here

  }

  private Flow getFlow(FlowModel model) {
    FlowModelHolder holder = new StaticFlowModelHolder(model);
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(holder);
    FlowAssembler assembler = new FlowAssembler(builder, new MockFlowBuilderContext("flow"));
    return assembler.assembleFlow();
  }
View Full Code Here

  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

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

    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();

    Flow notManaged = new Flow("notmanaged-child-flow");
    new EndState(notManaged, "finish");

    context.registerSubflow(childFlow);
View Full Code Here

  protected final Flow buildFlow() {
    FlowDefinitionResource resource = getResource(getResourceFactory());
    flowBuilderContext = new MockFlowBuilderContext(resource.getId(), resource.getAttributes());
    configureFlowBuilderContext(flowBuilderContext);
    FlowBuilder builder = createFlowBuilder(resource);
    FlowAssembler assembler = new FlowAssembler(builder, flowBuilderContext);
    return assembler.assembleFlow();
  }
View Full Code Here

  private FlowDefinitionHolder createFlowDefinitionHolder(FlowDefinitionResource flowResource) {
    FlowBuilder builder = createFlowBuilder(flowResource);
    FlowBuilderContext builderContext = new FlowBuilderContextImpl(flowResource.getId(),
        flowResource.getAttributes(), flowRegistry, flowBuilderServices);
    FlowAssembler assembler = new FlowAssembler(builder, builderContext);
    return new DefaultFlowHolder(assembler);
  }
View Full Code Here

      Class<?> flowBuilderClass = loadClass(builderInfo.getClassName());
      FlowBuilder builder = (FlowBuilder) flowBuilderClass.newInstance();
      AttributeMap<Object> flowAttributes = getFlowAttributes(builderInfo.getAttributes());
      FlowBuilderContext builderContext = new FlowBuilderContextImpl(builderInfo.getId(), flowAttributes,
          flowRegistry, flowBuilderServices);
      FlowAssembler assembler = new FlowAssembler(builder, builderContext);
      return assembler.assembleFlow();
    } catch (IllegalArgumentException e) {
      throw new FlowDefinitionConstructionException(builderInfo.getId(), e);
    } catch (InstantiationException e) {
      throw new FlowDefinitionConstructionException(builderInfo.getId(), e);
    } catch (IllegalAccessException e) {
View Full Code Here

    }
    FlowModelHolder flowModelHolder = new DefaultFlowModelHolder(flowModelBuilder);
    FlowBuilder flowBuilder = new FlowModelFlowBuilder(flowModelHolder);
    FlowBuilderContext builderContext = new FlowBuilderContextImpl(
        resource.getId(), resource.getAttributes(), flowRegistry, this.flowBuilderServices);
    FlowAssembler assembler = new FlowAssembler(flowBuilder, builderContext);
    DefaultFlowHolder flowHolder = new DefaultFlowHolder(assembler);

    flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), flowModelHolder);
    flowRegistry.registerFlowDefinition(flowHolder);
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.builder.FlowAssembler

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.