I am calling a subflow from a main flow. I have been able to pass an object ShareHolderProfile
to the SubFlow from the MainFlow. However, I am not sure if this same object is not being passed back to the MainFlow or I am not properly accessing it in my JSP. Here is how I am doing it.
MainFlow.xml
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="retriveAccount">
<var name="acctProfile" class="com.abc.xyz.account.ShareHolderProfile"/>
<view-state id="retriveAccount" view="AccountView">
<transition on="Success" to="createAccountSubFlow"/>
</view-state>
<subflow-state id="createAccountSubFlow" subflow="createAccountSubFlow">
<input name="acctProfile" value="acctProfile"/>
<transition on="finish" to="showAlternateRoute"/>
</subflow-state>
<view-state id="showAlternateRoute" view="showAlternateView" model="acctProfile">
<on-entry>
<evaluate someExpression result="viewScope.SomeValue"/>
</on-entry>
<transition on="viewAction" to="accountDetails"/>
</view-state>
SubFlow.xml
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="showAccount">
<input name="acctProfile" />
<view-state id="showAccount" view="randomView" model="acctProfile">
<on-entry>
<evaluate expression="SomExpression"/>
</on-entry>
<transition on="SomeEvent" to="NextState"/>
</view-state>
<view-state id="NextState" view="SomeRandomView" model="acctProfile">
<on-entry>
<evaluate expression="controller.Method(acctProfile)" result="viewScope.profileForm"/>
</on-entry>
<transition on="viewResult" to="finish"/>
</view-state>
<end-state id="finish" />
Now, for the most part, the flows in the applications works fine. However, the problem is that I have been trying to access some attributes (Member variable) from acctProfile in one of my jsp . Something like - acctProfile.FirstName
However, I am not able to do this. Is the acctProfile object not being passes from the subFlow to Mainflow or am I using it incorrectly in the JSP. Please advise.
Thanks in advance