0 Replies Latest reply on Apr 24, 2009 11:46 PM by Andre Fernando Salvati

    URL Access + Pageflow + task issue

    Andre Fernando Salvati Novice

      Seam 2.1.1 GA


      I've been trying to start a pageflow and a task with an URL (sent via e-mail). I've tried 2 approaches without success.

      Approach 1)

      Better, cause it is possible to choose the exception screen, but my screen couldn't find process variables at Business Process context.

      Approach 2)

      It's not possible to choose the exception screen but at least my process variables came in debug.seam page.

      Details (Approach 1)


      UsuarioEdit.page.xml (UsuarioEdit.xhtml has fields from process variables):

       <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
           view-id="/registroUsuario/UsuarioEdit.xhtml" action="#{registroUsuario.confirmar}">
           <begin-conversation pageflow="newuser"/>


           private Long taskIdFornecida;      
              public String confirmar() {
                TaskInstance task = jbpmContext.getTaskInstance(taskIdFornecida);
                     try {
                     catch (IllegalStateException e) {
                          statusMessages.add(StatusMessage.Severity.ERROR,"Registro já foi concluído");
                          return "inicio";
                     catch (Exception e) {
                          return "inicio";
                     taskId = taskIdFornecida;
                     return "usuario"; 


                     <transition name="usuario" to="usuario"></transition>
                     <transition name="inicio" to="inicio"></transition>
              <page name="usuario" view-id="/registroUsuario/UsuarioEdit.xhtml">
                     <transition name="inicio" to="inicio"></transition>
               <page name="inicio" view-id="/outros/inicio.xhtml"></page>  

      This error brings the next approach...

      Details (approach 2)

      When I try to put @StartTask at confirmar method it gives a sequence of errors like this:

       17:06:31,615 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
      java.lang.IllegalStateException: pageflow is not currently at a <page> or <start-page> node (note that pageflows that begin during the RENDER_RESPONSE phase should use <start-page> instead of <start-state>)
           at org.jboss.seam.pageflow.Pageflow.getPage(Pageflow.java:232) 

      So, I changed the pageflow...


               <start-page name="usuario" view-id="/registroUsuario/UsuarioEdit.xhtml">
                     <transition name="inicio" to="inicio"></transition>
               <page name="inicio" view-id="/outros/inicio.xhtml"></page> 


       Exception during request processing:
      Caused by javax.el.ELException with message: "java.lang.IllegalStateException: begin method invoked from a long-running conversation, try using @Begin(join=true) on method: confirmar" 

      @Begin(join true) doesn't change anything. Same error.


      - I was not able to solve errors on both approaches. Am I doing something wrong?

      - Is it the best way to direct a user from his mail box to a task inside my appication?