6 Replies Latest reply on Jul 14, 2007 7:57 PM by mocha

    possible to specify action in pageflow transition?

      Is it possible to specify a bean action in a pageflow transition (in the same way that this can be done using <from-action> in a pages.xml navigation case)? I have tried it as follows but it doesn't seem to work...

       <page name="history" view-id="/history.xhtml">
       <redirect/>
       <transition name="#{historyController.selectHistoryItem(item)}" to="historyitem"/>
       ....
       </page>
      
       <page name="historyitem" view-id="/historyitem.xhtml">
       ....
       </page>
      


       <h:dataTable value="#{selectedContact.history}" var="item">
       <h:column>
       <s:link action="#{historyController.selectHistoryItem(item)}" value="#{item.note}"/>
       </h:column>
       </h:dataTable>
      


      Basically I want to implement a master-detail pattern within a pageflow. Is there another way to do this?


        • 1. Re: possible to specify action in pageflow transition?
          ellenzhao

          yes. Do it like this:

          <page name="history" view-id="/history.xhtml">
           <redirect/>
           <transition name="youNameIt" to="historyitem">
           <action expression="#{historyController.selectHistoryItem(item)}"/>
           </transition>
           <transition name="youNameIt2" to="....">
           <action expression="...." />
           </transition>
           ....
           </page>
          
           <page name="historyitem" view-id="/historyitem.xhtml">
           ....
           </page>
          
          


          • 2. Re: possible to specify action in pageflow transition?

            thanks for the suggestion. Unfortunately I get the following error when trying this:

            Caused by org.jbpm.JbpmException with message: "couldn't evaluate expression '#{historyController.selectHistoryItem(item)}'"
            ...
            Caused by org.jbpm.jpdl.el.ELException with message: "Encountered "(", expected one of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&", "or", "||", "?"]"

            • 3. Re: possible to specify action in pageflow transition?
              ellenzhao

              the last time I wrote page flow definition in jPDL was last year December, so I do not know whether this Seam Enhanced EL is also working in jPDL....For your scenario there is a workaround. You can make your "item" your action bean managed (write it as a member like private Item historyItem; and write setter and getter. Change the signature of your selectHistoryItem, make it take no parameter. Finally expose the setter and getter in the business interface of your action bean), and bind the value of your historyItem somewhere in your page form (so you do not have to pass the item as parameter in your selectHistoryItem()). This way you can call the selectHistoryItem() in your jPDL file like this:

              <page name="history" view-id="/history.xhtml">







              ....


              Currently I am also implementing a master-detail pattern but using "nested conversations + rendering flags (all boolean) in conversation beans + multilevel, conditional facelet templating" approach.

              • 4. Re: possible to specify action in pageflow transition?
                ellenzhao

                sorry, forgot to use the code tag in my last post...I meant:

                <page name="history" view-id="/history.xhtml">
                 <redirect/>
                 <transition name="youNameIt" to="historyitem">
                 <action expression="#{historyController.selectHistoryItem}"/>
                 </transition>
                 <transition name="youNameIt2" to="....">
                 <action expression="...." />
                 </transition>
                 ....
                 </page>
                


                • 5. Re: possible to specify action in pageflow transition?
                  pmuir

                  jboss-el isn't currently working in jbpm, but should be for Seam 2.0.0.CR1

                  • 6. Re: possible to specify action in pageflow transition?

                    Thanks for the help with this. I got it working using DataModelSelection and the pageflow suggested by ellenzhao.

                    Looking forward to Seam 2.0.0.CR1 with jboss-el support from jbpm - will be a more elegant solution for my purposes.