A flow definition registrar that populates a flow definition registry with
flow definitions defined in externalized XML resources. Typically used in
conjunction with a
XmlFlowRegistryFactoryBean but may also be used
standalone in programmatic fashion.
By default, a flow definition registered by this registrar will be assigned a
registry identifier equal to the filename of the underlying definition
resource, minus the filename extension. For example, a XML-based flow
definition defined in the file "flow1.xml" will be identified as "flow1" when
registered in a registry.
Programmatic usage example:
BeanFactory beanFactory = ...
FlowDefinitionRegistry registry = new FlowDefinitionRegistryImpl();
FlowServiceLocator flowServiceLocator =
new DefaultFlowServiceLocator(registry, beanFactory);
XmlFlowRegistrar registrar = new XmlFlowRegistrar(flowServiceLocator);
File parent = new File("src/webapp/WEB-INF");
registrar.addLocation(new FileSystemResource(new File(parent, "flow1.xml"));
registrar.addLocation(new FileSystemResource(new File(parent, "flow2.xml"));
registrar.registerFlowDefinitions(registry);
author: Keith Donald |