Announcement Announcement Module
No announcement yet.
Webflow variable scope Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webflow variable scope


    Below is my flow xml.
    <flow xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    	<var name="quote" class="com.ins.entity.program1.Quote"/>
    	<view-state id="program1Start" view="Program1/Page1" model="quote">
    		<transition on="next" to="page2" />
    		<transition on="cancel" to="exitFLow"/>
    	<view-state id="page2" view="Program1/Page2" model="quote">
    		<transition on="next" to="page3" />
    		<transition on="back" to="program1Start"/>
    	<view-state id="page3" view="Program1/Page3" model="quote">
    		<transition on="next" to="search" />
    		<transition on="back" to="page2"/>
    	<end-state id="search" view="redirect:/common/Search.html"/>
    	<end-state id="exitFLow" view="redirect:/common/ProgramSelection.html"/>
    I need a object of "Quote" class which should be used only within this flow. So, i have created a variable with "quote" as you can see in above example which is used through out my flow.
    But the problem is that this object scope is not within the flow even if i logout and call session.invalide() and login again this object has its old values.

    How i can make my variable scope to flow?

    Please let me know if its not clear.
    Please help. Thanks

  • #2
    That should just work.. If it is still there make really sure that you are invalidating the session also if you are using another storage for your flow state (not the session) it has little use in invalidating the session. But judging from your observations I doubt that your session gets (properly) invalidated.


    • #3
      it properly gets invalidated because other objects that i used to store in session, like login object its get removed.
      But this web flow variable doesn't.


      • #4
        It should be working. But another way to do it is by executing and storing your variable in the flow scope. In brief, there are four scopes in webflow: conversation, flash, flow and view. One option is to keep your variable in the flow scope as follows:

        HTML Code:
        	<evaluate expression="myServiceOrFactory.createQuote()" result="flowScope.quote" />
        That way your quote object should be available along the flow life span.

        Good luck


        • #5
          That works !!!

          Thanks a lot !!!

          It works !! Thank you so much !!
          Here i have to create a factory class to create object.
          Is there any way so that i can create object just by referring the class?
          <var name="quote" class="com.ins.entity.program1.Quote"/>
          Thanks again !!!