2 Replies Latest reply on Aug 30, 2005 6:04 AM by Tim Squires

    Marking states as different types

    Tim Squires Newbie

      Hi,

      We have a web based process and would like to select a jsp page depending on state type.

      e.g.

      <sate name="Page 1">
       <config type="page.jsp">
       <transition name="tr1" to="Page 2"/>
      </state>
      <sate name="Page 2">
       <config type="anotherpage.jsp">
       <transition name="tr1" to="end"/>
      </state>


      The page.jsp and anotherpage.jsp pages are templates displaying different stuff. The JSP controller forwards the browser to the template after reading the variable for the current state.

      At the moment I set a variable using bean shell script to set a variable to the page template. This is not ideal because it does not let me go through the process definition and display what type of page to expect next, only when a state has been reached, the template can be accessed from the variable.

      Is there anything in the XML that can be used to indicate the template?

      Thanks for your time,
      Tim

        • 1. Re: Marking states as different types
          David Loiseau Newbie

          May be you can try something like this:

          <sate name="Page 1">
           <event type="node-enter">
           <action name="setType" class="org.test.setType">
           <type>page.jsp</type>
           </action>
           </event>
           <transition name="tr1" to="Page 2"/>
          </state>
          <sate name="Page 2">
           <event type="node-enter">
           <action name="setType" class="org.test.setType">
           <type>anotherpage.jsp</type>
           </action>
           </event>
           <transition name="tr1" to="end"/>
          </state>
          


          And set the variable in the org.test.setType class

          It's not exactly what you want, but this way you can parse the process definition and retrieve the associated type.

          May be it's possible to do with a script instead of an action ?



          Regards,
          David

          • 2. Re: Marking states as different types
            Tim Squires Newbie

            Thanks Alkero, I have been using scripts in node-enter but changed to an ActionHandler class because it tidy's up the xml alittle.

            This works good enough for now.

            Thanks again.


            Tim