marioosh
marioosh

Reputation: 28556

Spring WebFlow: What can i do with flow outcome?

I'm reading Spring WebFlow documentation, but I don't understand what can i do with outcome value in end-state of flow. Could You show me some practical example ? I wonder how to pass outcome variable to MVC Controller or another flow, but don't know how.

<flow>
    <end-state id="test2">
          <output name="id" value="123" />
    </end-state>
</flow>

Upvotes: 0

Views: 1637

Answers (1)

David
David

Reputation: 1521

You can access your output variables from the parent flow (if you have called a subflow) by using currentEvent.attributes (so in your example):

currentEvent.attributes.id

See section 3.10 Calling Subflows

You can also get them programatically in a FlowHandler by implementing the handleExecutionOutcome method. There is an example in the docs under the "Example FlowHandler" section of 11.4 Implementing custom FlowHandlers.

Upvotes: 1

Related Questions