Announcement Announcement Module
Collapse
No announcement yet.
Current State Id Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Current State Id

    Hi,
    I am new to Spring Webflow. I recently started looking into M4. I want to know how I can find the current state id in a Java method which in invoked in "evaluate" element.
    Thanks,
    Basheer.

  • #2
    If you need to access flow context like the current state from Java, it's usually best to implement and invoke a custom Action. See the Action interface. To invoke an action, simply use the evaluate tag like <evaluate expression="myAction"/>

    Alternatively, you could always pass such context into the method you are evaluating.

    Lastly, you can use the RequestContextHolder to look up flow context using a thread local.

    Keith

    Comment


    • #3
      Hi Keith,
      Thanks for the reply. Won't it be a good idea to make RequestContext available in the flowScope, so that it can be injected into any Java class, not just the ones that implement the Action interface?
      Thanks,
      Basheer.

      Comment


      • #4
        You can inject requestContext by referring to the variable "flowRequestContext" in your flow EL.

        Keith

        Comment


        • #5
          Wonderful. That is what I am looking for. Where do I find all such implicit variable names (like flowScope, flowRequestContext ect.)?
          Thanks,
          Basheer.

          Comment


          • #6
            Look at ImplicitFlowVariableResolver for EL and WebFlowOgnlExpressionParser for OGNL.

            Keith

            Comment

            Working...
            X