Announcement Announcement Module
Collapse
No announcement yet.
[SWF2.0] sophisticated transition error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SWF2.0] sophisticated transition error

    Doesn't seem to be working..

    Sophisticated transitional expressions are also supported when enclosed in a delimited expression
    My code:

    Code:
    <transition on="${event == 'review' || event == 'next'}" to="${NEXT_VIEW}">
    
    org.springframework.webflow.engine.NoMatchingTransitionException: No transition found on occurence of event 'next' in state 'traderUserGroup.view' of flow 'main-user-flow' -- valid transitional criteria are array<TransitionCriteria>
    [${event == 'review' || event == 'next'}
    JIRA http://jira.springframework.org/browse/SWF-680
    Last edited by jamesclinton; May 12th, 2008, 07:17 AM.

  • #2
    You need to say ${currentEvent.id == 'next'}, etc.

    Keith

    Comment


    • #3
      This now works. JIRA issue updated to record the XSD needs updating.

      Thanks.

      Comment


      • #4
        Correction, this hasn't solved the problem.

        Comment


        • #5
          I have confirmed this is a bug in 2.0.0. We'll have a fix in the upcoming 2.0.1 out tomorrow.

          Keith

          Comment


          • #6
            It seems that in SWF 2.3 dynamic expressions are not working for "to" of transition.
            This flow returns "Cannot find state with id '${flowScope.nextState}' in flow 'transition-flow'":

            <?xml version="1.0" encoding="UTF-8"?>
            <flow xmlns="http://www.springframework.org/schema/webflow"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="
            http://www.springframework.org/schema/webflow
            http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

            <on-start>
            <set name="flowScope.nextState" value="'state2'"/>
            </on-start>

            <action-state id="handleInvokeState">
            <evaluate expression="flowScope.nextState"/>
            <transition to="${flowScope.nextState}"/>
            </action-state>

            <view-state id="state1">
            </view-state>

            <view-state id="state2">
            </view-state>

            </flow>

            Is this a bug in SWF, or I am doing something wrong?

            Comment


            • #7
              Found solution: use #{} instead of ${}. Following works ok:

              <on-start>
              <set name="flowScope.nextState" value="'state2'"/>
              </on-start>

              <action-state id="handleInvokeState">
              <evaluate expression="flowScope.nextState"/>
              <transition to="#{flowScope.nextState}"/>
              </action-state>

              <view-state id="state1">
              </view-state>

              <view-state id="state2">
              <transition on="#{currentEvent.id == 'invokeDynamic'}" to="#{currentEvent.id}"/>
              </view-state>

              <view-state id="invokeDynamic"/>

              Comment

              Working...
              X