diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java index b3943780..d5a19997 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilder.java @@ -658,7 +658,11 @@ public class XmlFlowModelBuilder implements FlowModelBuilder { flowId = parent.substring(0, hashIndex).trim(); stateId = parent.substring(hashIndex + 1).trim(); try { - parentState = modelLocator.getFlowModel(flowId).getStateById(stateId); + if (StringUtils.hasText(flowId)) { + parentState = modelLocator.getFlowModel(flowId).getStateById(stateId); + } else { + parentState = flowModel.getStateById(stateId); + } if (parentState == null) { throw new FlowModelBuilderException("Unable to find state '" + stateId + "' in flow '" + flowId + "'"); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/spring-webflow-2.0.xsd b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/spring-webflow-2.0.xsd index 0c38ad2e..74247ab9 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/spring-webflow-2.0.xsd +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/builder/xml/spring-webflow-2.0.xsd @@ -249,9 +249,11 @@ The unique identifier of this state; must be unique to this flow. -For example
<state id="state" parent="flowId#stateId">
+The parent state this state should inherit from. +Specify the value in the form [flowId]#. +If inheriting from a state defined in another flow, the flowId prefix is required. +If inheriting from a state defined in this flow, the flowId should not be specified. +For example,
<action-state id="state" parent="myParentFlow#myParentState">
or
<action-state id="state" parent="#myLocalParentState">
]]>
@@ -449,9 +451,11 @@ The unique identifier of this state; must be unique to this flow. -For example
<state id="state" parent="flowId#stateId">
+The parent state this state should inherit from. +Specify the value in the form [flowId]#. +If inheriting from a state defined in another flow, the flowId prefix is required. +If inheriting from a state defined in this flow, the flowId should not be specified. +For example,
<view-state id="state" parent="myParentFlow#myParentState">
or
<view-state id="state" parent="#myLocalParentState">
]]>
@@ -662,9 +666,11 @@ The unique identifier of this state; must be unique to this flow. -For example
<state id="state" parent="flowId#stateId">
+The parent state this state should inherit from. +Specify the value in the form [flowId]#. +If inheriting from a state defined in another flow, the flowId prefix is required. +If inheriting from a state defined in this flow, the flowId should not be specified. +For example,
<decision-state id="state" parent="myParentFlow#myParentState">
or
<decision-state id="state" parent="#myLocalParentState">
]]>
@@ -779,9 +785,11 @@ The unique identifier of this state; must be unique to this flow. -For example
<state id="state" parent="flowId#stateId">
+The parent state this state should inherit from. +Specify the value in the form [flowId]#. +If inheriting from a state defined in another flow, the flowId prefix is required. +If inheriting from a state defined in this flow, the flowId should not be specified. +For example,
<subflow-state id="state" parent="myParentFlow#myParentState">
or
<subflow-state id="state" parent="#myLocalParentState">
]]>
@@ -885,9 +893,11 @@ The unique identifier of this state; must be unique to this flow. -For example
<state id="state" parent="flowId#stateId">
+The parent state this state should inherit from. +Specify the value in the form [flowId]#. +If inheriting from a state defined in another flow, the flowId prefix is required. +If inheriting from a state defined in this flow, the flowId should not be specified. +For example,
<end-state id="state" parent="myParentFlow#myParentState">
or
<end-state id="state" parent="#myLocalParentState">
]]>
@@ -1045,7 +1055,7 @@ The starting point of this flow. If not specified, the start state is the first @@ -1054,7 +1064,7 @@ Marks a flow model as abstract, preventing it from instantiating as a flow defin diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java index d50f9331..0be69007 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImpl.java @@ -49,7 +49,6 @@ public class FlowModelRegistryImpl implements FlowModelRegistry { public FlowModel getFlowModel(String id) throws NoSuchFlowModelException { try { return getFlowModelHolder(id).getFlowModel(); - } catch (NoSuchFlowModelException e) { if (parent != null) { // try parent