SWF-930 Development mode flag not set for flows registered using flow-location-pattern
Pattern locations now accepts an AttribtueMap for flow attributes. This map is passed to each flow resource found by the pattern.
This commit is contained in:
@@ -119,9 +119,10 @@ public class FlowDefinitionResourceFactory {
|
||||
/**
|
||||
* Create an array of flow definition resources from the path pattern location provided.
|
||||
* @param pattern the encoded {@link Resource} path pattern.
|
||||
* @param attributes the flow definition meta attributes to configure
|
||||
* @return the flow definition resources
|
||||
*/
|
||||
public FlowDefinitionResource[] createResources(String pattern) throws IOException {
|
||||
public FlowDefinitionResource[] createResources(String pattern, AttributeMap attributes) throws IOException {
|
||||
if (resourceLoader instanceof ResourcePatternResolver) {
|
||||
ResourcePatternResolver resolver = (ResourcePatternResolver) resourceLoader;
|
||||
Resource[] resources;
|
||||
@@ -137,7 +138,7 @@ public class FlowDefinitionResourceFactory {
|
||||
FlowDefinitionResource[] flowResources = new FlowDefinitionResource[resources.length];
|
||||
for (int i = 0; i < resources.length; i++) {
|
||||
Resource resource = resources[i];
|
||||
flowResources[i] = new FlowDefinitionResource(getFlowId(resource), resource, null);
|
||||
flowResources[i] = new FlowDefinitionResource(getFlowId(resource), resource, attributes);
|
||||
}
|
||||
return flowResources;
|
||||
} else {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.springframework.webflow.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -167,8 +168,9 @@ class FlowRegistryFactoryBean implements FactoryBean, BeanClassLoaderAware, Init
|
||||
for (int i = 0; i < flowLocationPatterns.length; i++) {
|
||||
String pattern = flowLocationPatterns[i];
|
||||
FlowDefinitionResource[] resources;
|
||||
AttributeMap attributes = getFlowAttributes(Collections.EMPTY_SET);
|
||||
try {
|
||||
resources = flowResourceFactory.createResources(pattern);
|
||||
resources = flowResourceFactory.createResources(pattern, attributes);
|
||||
} catch (IOException e) {
|
||||
IllegalStateException ise = new IllegalStateException(
|
||||
"An I/O Exception occurred resolving the flow location pattern '" + pattern + "'");
|
||||
|
||||
Reference in New Issue
Block a user