Announcement Announcement Module
Collapse
No announcement yet.
decision-state based on entry actions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • decision-state based on entry actions

    Howdy all,

    I've been struggling with this for a better part of a day, I hope that someone is as eager to tryout the RC1 as I. The problem is that in 1.0ea I had:
    Code:
    <decision-state id="state">
    	<action bean="actionBean" method="method()" />
    	<transition on="yes" to="yesState" />
    	<transition on="no" to="noState" />
    </decision-state>
    however in 1.0 RC1 (I used nightly build 20060501), the DTD has changed, so I modified my flow definition to the following:
    Code:
    <decision-state id="state">
    	<entry-actions>
    		<action bean="actionBean" method="method()" />
    	</entry-actions>
    	<if test="${#result == 'yes'}" then="yesState" />
    	<if test="${#result == 'no'}" then="noState" />
    </decision-state>
    but, sadly this does not work (throws NoMatchingTransitionException), what need's to be set in the <if test="..." /> for this to work?
    The method() on the actionBean returns a boolean, the #result == 'yes' was my approximation of what could be expected...

    thanks

    zoran

  • #2
    decision-state based on entry actions

    Hi again,
    I belive that I've found the cause for this; the Event generated by the action is not propagated further, see the following code excepts:
    Code:
    ActionExecutor.execute(...):54
        return action.execute(context);
    ActionList.execute(...):162
        ActionExecutor.execute((Action)it.next(), context);
    DecisionState.enter(...):191
        entryActionList.execute(context);
    the Event generated in ActionExecutor.execute(...) is not propagated from ActionList to the DecisionState, and thus lost for the <if> logic, should I split this decision state into two states: action state for actionBean, and a decision state for event handling?

    Comment


    • #3
      in 1.0 RC1 use a action-state:
      HTML Code:
      <action-state id="state">
          <action bean="actionBean" method="method()" />
          <transition on="yes" to="yesState" />
          <transition on="no" to="noState" />
      </action-state>
      Keith

      Comment


      • #4
        decision-state based on entry actions Reply to Thread

        It works, thanks

        Comment


        • #5
          Chapter 2 of the reference should probably be updated with this. It caused me some consternation to try the XML given under the decision state section only to have it not work.

          Thanks,
          Bubba

          Comment

          Working...
          X