Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: 1.1M1 snapshot, <flow:enable-scopes>

  1. #11

    Default

    I found a workaround.

    SWF:
    Code:
      <start-state idref="start" />
    
      <action-state id="start">
        <evaluate-action expression="externalContext.applicationMap['org.springframework.web.context.WebApplicationContext.ROOT'].getBean('phonebookFlowAction').start()" />
      </action-state>
    
      <subflow-state id="INPUT_FLOW" flow="InputFlow">
        <attribute-mapper>
          <input-mapper>
            <mapping source="externalContext.applicationMap['org.springframework.web.context.WebApplicationContext.ROOT'].getBean('phonebookFlowData').inputFlowParam" target="flowParam" />
          </input-mapper>
          <output-mapper>
            <mapping source="flowParam" target="externalContext.applicationMap['org.springframework.web.context.WebApplicationContext.ROOT'].getBean('phonebookFlowData').inputFlowParam" />
          </output-mapper>
        </attribute-mapper>
        <transition to="afterInputFlow" />
      </subflow-state>
    
      <action-state id="afterInputFlow">
        <evaluate-action expression="externalContext.applicationMap['org.springframework.web.context.WebApplicationContext.ROOT'].getBean('phonebookFlowAction').afterInputFlow()" />
      </action-state>
    
      ...
    Spring Beans:
    Code:
      <bean id="phonebookFlowAction"
          class="foo.phonebook.PhonebookFlowAction"
          scope="request"
          autowire="byType"
          dependency-check="objects" />
    
      <bean id="phonebookFlowData"
          class="foo.phonebook.PhonebookFlowData"
          scope="flow" />
    
      ...
    However, I hope that SWF become easier.
    Thanks.
    Last edited by slopetown; May 17th, 2007 at 10:49 AM.

  2. #12
    Join Date
    Jul 2006
    Posts
    126

    Default

    Thanks so much for your reply,

    I changed the scope to request. Added the following listener in the web.xml and things have started working.
    <listener> <listener-class>org.springframework.web.context.request.Requ estContextListener</listener-class>
    </listener>

    I appreciate all your help.

    Regards,
    Shashi

  3. #13

    Default

    I raised this issue.
    http://opensource.atlassian.com/proj...browse/SWF-312

    and Shashi, you are replying to a wrong thread.

  4. #14
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    I believe the changes I have submitted for SWF-287 and SWF-301 would allow this to work in a JSF environment as follows with no additional work:

    Code:
    <action-state id="start">
        <evaluate-action expression="#{phonebookFlowAction.start()}" />
      </action-state>
    
      <subflow-state id="INPUT_FLOW" flow="InputFlow">
        <attribute-mapper>
          <input-mapper>
            <mapping source="#{phonebookFlowData.inputFlowParam}" target="flowParam" />
          </input-mapper>
          <output-mapper>
            <mapping source="flowParam" target="#{phonebookFlowData.inputFlowParam}" />
          </output-mapper>
        </attribute-mapper>
        <transition to="afterInputFlow" />
      </subflow-state>
    
      <action-state id="afterInputFlow">
        <evaluate-action expression="#{phonebookFlowAction.afterInputFlow()}" />
      </action-state>
    It might be interesting to consider how to also make this work in a non-JSF application that is configured to use the ELExpressionParser. This could be done rather simply by providing an alternate ELContext implementation that is preconfigured to use the DelegatingVariableResolver from the JSF integration.

    -Jeremy

  5. #15

    Default

    This is a very attractive idea.
    <evaluate-action> is easier than <bean-action>.
    However, I plan to use SWF+Struts.
    If this doesn't work in non-JSF environment, I cannot use this.
    Therefore, I think.
    Why cannot OGNL be used for the same purpose?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •