/** * Register a flow defined at the following location as an .xml file. * This may be a path to a single resource or a ANT-style path expression that * matches multiple resources. * @param path the resource path to the externalized flow definition resource. */ public FlowDefinitionRegistryBuilder addFlowLocation(String path) { this.addFlowLocation(path, null, null); return this; }
@Bean public FlowDefinitionRegistry flowRegistry() { Map<String, Object> flowAttributes = new HashMap<>(); flowAttributes.put("foo", "bar"); flowAttributes.put("bar", 2); return getFlowDefinitionRegistryBuilder().setParent(parentRegistry()) .addFlowLocation("org/springframework/webflow/config/flow.xml", "flow", flowAttributes) .addFlowLocation("/some/path/that/is/bogus.xml") .addFlowLocationPattern("org/springframework/webflow/config/flows/*.xml") .addFlowBuilder(new FooFlowBuilder()) .addFlowBuilder(new FooFlowBuilder(), "foo2") .addFlowBuilder(new FooFlowBuilder(), "foo3", flowAttributes) .build(); }
/** * Register a flow defined at the following location as an .xml file. * This may be a path to a single resource or a ANT-style path expression that * matches multiple resources. * @param path the resource path to the externalized flow definition resource. */ public FlowDefinitionRegistryBuilder addFlowLocation(String path) { this.addFlowLocation(path, null, null); return this; }
@Override public Flow buildFlow(final String location, final String id) { val builder = new FlowDefinitionRegistryBuilder(this.applicationContext, this.flowBuilderServices); builder.setParent(this.loginFlowDefinitionRegistry); builder.addFlowLocation(location, id); val registry = builder.build(); return (Flow) registry.getFlowDefinition(id); }
@Bean public FlowDefinitionRegistry parentRegistry() { return getFlowDefinitionRegistryBuilder() .addFlowLocation("org/springframework/webflow/config/flow.xml", "parentFlow") .build(); }
@Bean public FlowDefinitionRegistry flowRegistry() { return getFlowDefinitionRegistryBuilder() .addFlowLocation("org/springframework/webflow/config/flow.xml").build(); }