emre
emre

Reputation: 11

Returning value (output) from web flow

I am using spring web-flow 2.0 and I need to return a variable from sub-flow to parent flow like:

<end-state id="end" >
    <output name="mvViewBean" value="viewBean" />
</end-state>    

and use it inside my parent flow like :

<subflow-state id="updateSubflowState" subflow="mv-update" >
    <on-exit>
        <evaluate expression="mvService.onblabla(mvViewBean)" />
    </on-exit>
</subflow-state>

Do i need to define variable definitions or something else?

Upvotes: 1

Views: 4224

Answers (2)

adam
adam

Reputation: 71

Just came across this issue...The currentEvent does work, but if you indicate that you accept the variable in your updateSubflowState through a

    <output name="mvViewBean" value="flowScope.mvViewBean"/>

then you will be able to access it as mvViewBean.

Upvotes: 5

Britanico Merida
Britanico Merida

Reputation: 31

Yo can get the output values getting attribute in currentEvent.

<subflow-state id="updateSubflowState" subflow="mv-update" >
    <on-exit>
        <evaluate expression="mvService.onblabla(currentEvent.attributes.mvViewBean)" />
    </on-exit>
</subflow-state>

Upvotes: 2

Related Questions