-1

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?

Neel
  • 2,100
  • 5
  • 24
  • 47
  • Why would a spring upgrade influence your web flow flows? You are upgrading Spring not Spring Web Flow. – M. Deinum Jun 10 '15 at 05:44
  • @M.Deinum Actually yes, I am upgrading spring-webflow along with it. Spring 2.x came as a single module, but in 3.x, it is available component wise. – Neel Jun 10 '15 at 13:07
  • Then your question isn't right and it has nothing to do with the spring upgrade but the web flow upgrade. Which is different, please explain from which web flow version you are upgrading. – M. Deinum Jun 10 '15 at 13:28
  • @M.Deinum Thanks - I have updated the question with spring web flow module references. Please let me know if you need more information. – Neel Jun 10 '15 at 14:15
  • 1
    Still you don't make any sense... Upgrading from Spring 2.5.6 to web flow 2.3.2 those 2 things have nothing to do with each other. Nor do I understand why you need to modify your flows they should still work. – M. Deinum Jun 10 '15 at 14:21
  • @M.Deinum When I was using Spring 2.5.6, I did not need the webflow dependency, but when I upgraded to Spring 3.x, I needed to include the webflow component. The webflow configuration I was using came from the legacy code, and the new config is the one I am trying to write. Hope that clarifies it better? – Neel Jun 10 '15 at 17:14
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/80217/discussion-between-neel-and-m-deinum). – Neel Jun 10 '15 at 18:14
  • 1
    No it still doesn't make sense, you either had web flow else the web flow would be pretty useless. So you are upgrading spring web flow, if it is only a spring upgrade you don't need to change anything. – M. Deinum Jun 11 '15 at 05:46
  • Awesome - your comments actually pointed in the right direction - I actually did not have to do anything to use Spring webflow! Thanks! – Neel Jun 15 '15 at 03:11

2 Answers2

0

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>
QGA
  • 3,114
  • 7
  • 39
  • 62
  • Thanks for the explanation, but the webflow from Spring 2.x is given. All i need to do is write the equivalent in Spring 3.x. – Neel Jun 10 '15 at 13:09
  • 1
    Your spring upgrade has nothing to do with web flow. There isn't even a sprig web flow 3. Basically your questions and comments are confusing. – M. Deinum Jun 10 '15 at 13:29
0

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>.

Neel
  • 2,100
  • 5
  • 24
  • 47