Announcement Announcement Module
Collapse
No announcement yet.
multiple <evalates> not working inside an action state Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • multiple <evalates> not working inside an action state

    Hi,

    today I added an action state to the beginning of my flow.

    In this action state I basically wanted to populate my scope with multiple objects that would be used in the jsp in the next view states (some collections for drop down lists which I wanted to keep seperate to the main model used in the flow) so I had a few <evaluate> tags which called methods on a service class to retrieve collections and put them in flowscope variables.

    I soon realised that only the first evaluate was executing, and second was skipped.

    In the end I had to move them to the <on-start> section, where they worked ok.

    However this is not the best solution for me, because I may have to setup quite a lot of data, and I would rather set it up in between states of the flow as its needed rather than all at the start.

    hope you can help

    thanks

  • #2
    I am having the same issue. Did you every find a better way to do this?

    Comment


    • #3
      Try using 'set' rather than 'evaluate'. The action state will attempt to transition from an 'evaluate' if a matching transition exists, whereas 'set' simply sets a variable in a scope.

      Comment


      • #4
        we ended up doing these things in the action instead and putting them in the flowscope from the action. In the end we decided to go away from web flow, it started out nice but then it became far too complex. We are now back using spring mvc which is much less cumbersome and easier to unit test. There is also a Spring class called AbstractWizardFormController which we may decide to use.

        Comment


        • #5
          Originally posted by emmettwalsh View Post
          we ended up doing these things in the action instead and putting them in the flowscope from the action.
          You can achieve what you wanted within 'on-entry' of the action state. This doesn't trigger events upon evaluation.

          Originally posted by emmettwalsh View Post
          In the end we decided to go away from web flow, it started out nice but then it became far too complex.
          Really? Can you explain why?

          Comment


          • #6
            well a couple of reasons really.., if you have some answers to my gripes, then that would be great..

            a) our application sits inside an existing portal, thus its entirely possible for a user to click other links and thus leave some flows without getting to their end states. I assume this is not good as the server holds on to all these flows and snapshots etc.

            b) when we used converters for some fields in our form, we ended up having to bind all other fields explicitly in the flow files. Our forms are big so this is a lot of xml that has laready cause problems for newbies on the proj

            c) we used the ajax flow tile resolver and it broke our spring mvc tiles resolver. (but we since switched our flows to use normal controllers for ajax requests and went back to the normal tile resolver.

            d) AbstractXmlFlowExecutionTests gets a bit difficult to maintain when there are a lot of states and transitions in a flow. We ended up writing normal unit tests in the end for the *Action classes.

            e) Our application has multiple flows and thus we ended up duplicating exception transitions in our different flow files. Still not sure how to handle exceptions in a smart way across all our different flows.

            Comment


            • #7
              Originally posted by emmettwalsh View Post
              d) AbstractXmlFlowExecutionTests gets a bit difficult to maintain when there are a lot of states and transitions in a flow. We ended up writing normal unit tests in the end for the *Action classes.
              Yes, I'd only write AbstractXmlFlowExecutionTests for transition logic and asserting scoped values before view-rendering.

              Originally posted by emmettwalsh View Post
              e) Our application has multiple flows and thus we ended up duplicating exception transitions in our different flow files. Still not sure how to handle exceptions in a smart way across all our different flows.
              You can specify global-transitions that are inherited into different flows.

              Comment

              Working...
              X