I have a MainFlow.xml which calls a SubFlow.xml and while doing so, the main flow passes an object called orderForm to the subFlow. The subFlow then uses by simply specifying an input tag at the start of the flow (See Below)
<input name="orderForm" />
In the main flow, I instantiate this object by using the code below
<var name="orderForm" class="abc.xyz.pqr.mvc.order.OrderForm"/>
Now, the reason I have a subflow is that I need to reused the view states and decisions states in this subflow in multiple scenarios. The issue I am facing right now is unless I enter the subflow from within the mainflow, the object orderForm is always null.
I would typically want a solution that allows me to check if orderForm is null at the start of the flow and if it is, create a new instant of the object. I cannot do it the same way as the mainflow does it (above) because then everytime, I enter the subflow from within the main flow, I will have a new orderForm object.
Please advise. And since I am new to Spring, please be as specific as you can. Thanks
You can do something like this …
You have to keep it as the first state after input, so that it will be picked up first
use “createOrderForm” to create a new instance of the form …