Bubba Puryear
Apr 13th, 2006, 05:25 PM
Perhaps I'm being dense, but I can not seem to get an output-mapper to work for a subflow that I've got. Here's a parent flow:
<flow start-state="start">
<action-state id="start">
<action bean="formAction" method="setupForm"/>
<transition on="success" to="edit-construct-cassettes-subflow"/>
<transition on="error" to="finish"/>
</action-state>
<subflow-state id="edit-construct-cassettes-subflow" flow="edit-construct-cassettes-subflow">
<attribute-mapper>
<input-mapper>
<mapping source="${flowScope.construct}" target="construct"/>
</input-mapper>
<output-mapper>
<mapping source="construct" target="construct"/>
</output-mapper>
</attribute-mapper>
<transition on="finish" to="saveConstruct"/>
<transition on="cancel" to="finish"/>
</subflow-state>
<action-state id="saveConstruct">
<action bean="formAction" method="saveConstruct"/>
<transition on="success" to="finish"/>
<transition on="error" to="edit-construct-cassettes-subflow"/>
</action-state>
<end-state id="finish" view="externalRedirect:${externalContext.contextPath}/app/view/construct.html?pk=${flowScope.construct.pk}"/>
<import resource="edit-cassette-flow-context.xml"/>
</flow>
and here's the subflow, just for reference sake:
<flow start-state="editConstructCassettes">
<view-state id="editConstructCassettes" view="qc/construct/editCassettes">
<entry-actions>
<action bean="formAction" method="setupReferenceData"/>
</entry-actions>
<transition on="submit" to="finish">
<action bean="formAction" method="bindAndValidate"/>
</transition>
<transition on="delete" to="deleteCassette"/>
<transition on="complement" to="complementCassette"/>
<transition on="addCassette" to="addCassette">
<action bean="formAction" method="bind"/>
</transition>
<transition on="cancel" to="cancel"/>
</view-state>
<action-state id="addCassette">
<action bean="formAction" method="addCassette"/>
<transition on="success" to="editConstructCassettes"/>
<transition on="error" to="editConstructCassettes"/>
</action-state>
<action-state id="complementCassette">
<action bean="formAction" method="complement"/>
<transition on="success" to="editConstructCassettes"/>
<transition on="error" to="editConstructCassettes"/>
</action-state>
<action-state id="deleteCassette">
<action bean="formAction" method="delete"/>
<transition on="success" to="editConstructCassettes"/>
<transition on="error" to="editConstructCassettes"/>
</action-state>
<end-state id="cancel">
<output-attribute name="construct"/>
</end-state>
<end-state id="finish" view="externalRedirect:${externalContext.contextPath}/app/view/construct.html?pk=${flowScope.construct.pk}">
<output-attribute name="construct"/>
</end-state>
<import resource="edit-cassette-flow-context.xml"/>
</flow>
Now, the input-mapper seems to work well enough -- I get to my view. But when I submit, I get this:
ERROR: Servlet.service() for servlet neogenie threw exception [[neogenie]] <2006-04-13 17:10:18,684>
ognl.NoSuchPropertyException: org.springframework.webflow.execution.impl.FlowExe cutionControlContextImpl.construct
at ognl.ObjectPropertyAccessor.setProperty(ObjectProp ertyAccessor.java:133)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1629 )
at ognl.ASTProperty.setValueBody(ASTProperty.java:105 )
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.ja va:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at org.springframework.binding.expression.support.Ogn lExpression.setValue(OgnlExpression.java:73)
at org.springframework.binding.mapping.Mapping.map(Ma pping.java:89)
at org.springframework.binding.mapping.DefaultAttribu teMapper.map(DefaultAttributeMapper.java:77)
at org.springframework.webflow.support.AbstractFlowAt tributeMapper.mapSubflowOutput(AbstractFlowAttribu teMapper.java:60)
at org.springframework.webflow.SubflowState.mapSubflo wOutput(SubflowState.java:158)
at org.springframework.webflow.SubflowState.onEvent(S ubflowState.java:147)
at org.springframework.webflow.Flow.onEvent(Flow.java :630)
at ...
Am I missing something obvious or not finding the right documentation to steer me where I need to go? Thanks.
<flow start-state="start">
<action-state id="start">
<action bean="formAction" method="setupForm"/>
<transition on="success" to="edit-construct-cassettes-subflow"/>
<transition on="error" to="finish"/>
</action-state>
<subflow-state id="edit-construct-cassettes-subflow" flow="edit-construct-cassettes-subflow">
<attribute-mapper>
<input-mapper>
<mapping source="${flowScope.construct}" target="construct"/>
</input-mapper>
<output-mapper>
<mapping source="construct" target="construct"/>
</output-mapper>
</attribute-mapper>
<transition on="finish" to="saveConstruct"/>
<transition on="cancel" to="finish"/>
</subflow-state>
<action-state id="saveConstruct">
<action bean="formAction" method="saveConstruct"/>
<transition on="success" to="finish"/>
<transition on="error" to="edit-construct-cassettes-subflow"/>
</action-state>
<end-state id="finish" view="externalRedirect:${externalContext.contextPath}/app/view/construct.html?pk=${flowScope.construct.pk}"/>
<import resource="edit-cassette-flow-context.xml"/>
</flow>
and here's the subflow, just for reference sake:
<flow start-state="editConstructCassettes">
<view-state id="editConstructCassettes" view="qc/construct/editCassettes">
<entry-actions>
<action bean="formAction" method="setupReferenceData"/>
</entry-actions>
<transition on="submit" to="finish">
<action bean="formAction" method="bindAndValidate"/>
</transition>
<transition on="delete" to="deleteCassette"/>
<transition on="complement" to="complementCassette"/>
<transition on="addCassette" to="addCassette">
<action bean="formAction" method="bind"/>
</transition>
<transition on="cancel" to="cancel"/>
</view-state>
<action-state id="addCassette">
<action bean="formAction" method="addCassette"/>
<transition on="success" to="editConstructCassettes"/>
<transition on="error" to="editConstructCassettes"/>
</action-state>
<action-state id="complementCassette">
<action bean="formAction" method="complement"/>
<transition on="success" to="editConstructCassettes"/>
<transition on="error" to="editConstructCassettes"/>
</action-state>
<action-state id="deleteCassette">
<action bean="formAction" method="delete"/>
<transition on="success" to="editConstructCassettes"/>
<transition on="error" to="editConstructCassettes"/>
</action-state>
<end-state id="cancel">
<output-attribute name="construct"/>
</end-state>
<end-state id="finish" view="externalRedirect:${externalContext.contextPath}/app/view/construct.html?pk=${flowScope.construct.pk}">
<output-attribute name="construct"/>
</end-state>
<import resource="edit-cassette-flow-context.xml"/>
</flow>
Now, the input-mapper seems to work well enough -- I get to my view. But when I submit, I get this:
ERROR: Servlet.service() for servlet neogenie threw exception [[neogenie]] <2006-04-13 17:10:18,684>
ognl.NoSuchPropertyException: org.springframework.webflow.execution.impl.FlowExe cutionControlContextImpl.construct
at ognl.ObjectPropertyAccessor.setProperty(ObjectProp ertyAccessor.java:133)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1629 )
at ognl.ASTProperty.setValueBody(ASTProperty.java:105 )
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.ja va:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at org.springframework.binding.expression.support.Ogn lExpression.setValue(OgnlExpression.java:73)
at org.springframework.binding.mapping.Mapping.map(Ma pping.java:89)
at org.springframework.binding.mapping.DefaultAttribu teMapper.map(DefaultAttributeMapper.java:77)
at org.springframework.webflow.support.AbstractFlowAt tributeMapper.mapSubflowOutput(AbstractFlowAttribu teMapper.java:60)
at org.springframework.webflow.SubflowState.mapSubflo wOutput(SubflowState.java:158)
at org.springframework.webflow.SubflowState.onEvent(S ubflowState.java:147)
at org.springframework.webflow.Flow.onEvent(Flow.java :630)
at ...
Am I missing something obvious or not finding the right documentation to steer me where I need to go? Thanks.