What is the best way to get the full list of FLOW IDs generated by Spring Webflow?
Here is my configuration:
List of flow ids can be identified by the way they are defined in flow-registry. By default, flows will be assigned registry identifiers equal to their filenames minus the file extension, unless a registry base path is defined.
Let me explain this with examples:
Scenario 1: flow-location and base-path is not specified:
Flow id: example
Scenario 2: flow-location-pattern and base-path is not specified :
If you have flows like /WEB-INF/pageFlows/example1-flow.xml, /WEB-INF/pageFlows/example2-flow.xml, flow ids are: example1-flow, example2-flow respectively.
Scenario 3: Your own id is specified:
Flow id: myExampleId
Scenario 4: base-path is specified:
Flows will now be assigned registry identifiers equal to the the path segment between their base path and file name. Flow id: pageFlows
Scenario 5: flow-location-pattern and base-path is specified:
Flows will now be assigned registry identifiers equal to the the path segment between their base path and file name. So if you have flows located in /pageFlows1/example1, /pageFlows2/example2 directories within WEB-INF, flow ids are: pageFlows1, pageFlows2 respectively.
EDIT :
To get flow ids programmatically:
Assuming your flow controller and flowexecutor definitions as below in webflow-config xml file:
//flowRegistry is alredy mentioned in your question
You can retrieve flow definition ids registered as below: (I am calling this from a Controller which extends AbstractController, thats why you see getServletContext() method)
ApplicationContext context =
(ApplicationContext)getServletContext().getAttribute(
DispatcherServlet.SERVLET_CONTEXT_PREFIX + "yourWebContextName");
FlowController controller = (FlowController)context.getBean("flowController");
FlowExecutorImpl flowExecutorImpl = (FlowExecutorImpl)controller.getFlowExecutor();
FlowDefinitionRegistryImpl flowDefinitionRegistryImpl = (FlowDefinitionRegistryImpl)flowExecutorImpl.getDefinitionLocator();
//Assuming you have log configured
log.info("Registered Flow Ids are:"+flowDefinitionRegistryImpl.getFlowDefinitionIds());
FlowController has access to FlowExecutor(initial point of entry for webflow). FlowExecutor has access to flowDefinitionRegistry where all flows are registered before being served to requests.
Hope this helps.