6 Replies Latest reply on Sep 13, 2006 4:56 PM by Gavin King

    Pageflow executed before the model values are applied

    Andrew Bailey Newbie

      I am seeing a problem in that the pageflow seems to be executed before the model values are
      applied, is this a bug or is it a problem with my configuration.

      //the page is first requested
      14:03:23,365 INFO [DocumentRegisterEntryBean] Start called
      14:03:23,380 INFO [DocumentRegisterEntryBean] getType null
      14:03:23,402 INFO [DocumentRegisterEntryBean] getType null

      //the form is submitted, getType is called by the pageflow before the set method.
      14:03:27,340 INFO [DocumentRegisterEntryBean] getType null
      14:03:27,341 INFO [DocumentRegisterEntryBean] setType register
      14:03:27,342 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
      javax.servlet.ServletException
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:156)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain
      ........
      Caused by: org.jbpm.JbpmException: decision expression '#{documentRegister.type}' returned null
      at org.jbpm.graph.node.Decision.execute(Decision.java:110)
      ... 46 more


      The form

      <h:form>
      <h:outputText value="#{messages.itIsA}"/>
      <h:selectOneRadio value="#{documentRegisterEntry.type}">
      <f:selectItem
      itemValue="document" itemLabel="#{messages.document}"/>
      <f:selectItem
      itemValue="register" itemLabel="#{messages.register}"/>
      </h:selectOneRadio>

      <h:commandButton action="next" value="#{messages.next}" />
      </h:form>

      The code

      @Scope(SESSION)
      @Name("documentRegisterEntry")
      public class DocumentRegisterEntryBean implements Serializable, DocumentRegisterEntry
      {

      private String type;

      @Logger
      private Log logger;

      @In(create=true)
      private Document document;

      @PersistenceContext()//type=EXTENDED)
      private EntityManager em;

      @Create
      //@Begin()
      @Begin(pageflow="documentRegisterEntry")
      public void start()
      {
      logger.info("Start called");
      }

      @End
      // @Transactional()
      public void save()
      {
      logger.info("Save called");
      }

      @Remove @Destroy
      public void destroy()
      {
      logger.info("Destroy called");
      }

      public Document getDocument()
      {
      logger.info("getDocument "+document);
      return document;
      }

      public void setDocument(Document document)
      {
      logger.info("setDocument "+document);
      this.document = document;
      }

      public String getType()
      {
      logger.info("getType "+type);
      return type;
      }

      public void setType(String type)
      {
      logger.info("setType "+type);
      this.type = type;
      }


      The pageflow

      <?xml version="1.0"?>

      <pageflow-definition name="documentRegisterEntry">
      <start-page name="type" view-id="/documentOrRegister.xhtml">


      </start-page>




      <!-- action is never triggered -->



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





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








      Thanks in advance
      Andy Bailey
      www.hazlorealidad.com