Spring upgrade on-start equivalent

121 views Asked by At

I am trying to use Spring Webflow 2.3.2.

I have a legacy web flow similar to:

<start-state id-ref="A" />
<action-state id="A">
    <action bean="B" />
    <transition on="success" to="T" />
</action-state>
<action-state id="T">
    ...
</action-state>

The equivalent code that I am writing for Spring Webflow 2.3.2 is:

<on-start>
    <evaluate expression="B" />
</on-start>
<action-state>
    <transition on="success" to="T" />
</action-state>
<action-state id="T">
    ...
</action-state>

Clearly I am missing the string to connect the initial evaluation to the transition. How can I connect the two?

2

There are 2 answers

0
Neel On BEST ANSWER

Based on comments from @M. Deinum, I realize that a Spring upgrade does not affect Spring webflow usage in the application. The new webflow which finally worked is:

<action-state id="A">
    <evaluate expression="B" />
    <transition on="success" to="T" />
</action-state>
<action-state id="T">
    ...
</action-state>

All that was required is to replace <action bean="B" /> with <evaluate expression="B" /> and add an id to the <action-state>.

2
QGA On

Let's assume your flow starts with a form

Form

<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
<input type="hidden" name="_eventId" value="send" /> //This starts the flow

Flow.xml

<view-state  id="showForm" model="formModel">
    <transition on="send" to="send2"></transition>
</view-state>
<action-state id="send2">
    <evaluate expression="..."></evaluate>
    <transition to="send3"></transition>
</action-state>
<view-state id="send3">
</view-state>