6 Replies Latest reply on May 6, 2009 9:55 AM by frinux

    Is mail blocking?

    frinux

      Hi,
      I want to know if the mail node is blocking the process flow or not?
      Is it better to put the mail node in a Fork or direclty inside the process flow?

      Here is my workflow design:

      [url=http://www.casimages.com/img.php?i=090427111831651970.jpg][img]http://nsa08.casimages.com/img/2009/04/27/mini_090427111831651970.jpg[/img][/url]

        • 1. Re: Is mail blocking?
          frinux

          It seems mail node is blocking, I just tried. I would like to handle when the sending of a mail fails. I saw that this node can handle exceptions, so I added one :

          <mail-node name="notifier_valideur" to="#{demande.valideur.email}" template="task-assign">
           <subject>#{mailSubject}</subject>
           <text>#{mailText}</text>
           <exception-handler exception-class="javax.mail.SendFailedException">
           <action class="InvalidEmailAddressExceptionHandler" name="mailFailed"></action>
           </exception-handler>
           <exception-handler exception-class="com.sun.mail.smtp.SMTPAddressFailedException">
           <action class="InvalidEmailAddressExceptionHandler" name="smtpFailed"></action>
           </exception-handler>
           <transition to="valider_demande"></transition>
           </mail-node>


          Result is that I still get the exception, and workflow stops here. I even don't get inside the InvalidEmailAddressExceptionHandler class.

          What's wrong?

          • 2. Re: Is mail blocking?
            frinux

            I still have this problem. Can someone indicate how to use the exception handler? Seems I got something wrong (or a bug in jBPM ?!)

            • 3. Re: Is mail blocking?
              frinux

              Ok it seems my ActionHandler was wrong.

              But now another problem. It seems jBPM wants to log the exception in the database, and that tjis exception is too long for mysql column :

              106375 [http-8080-Processor23] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 22001
              106375 [http-8080-Processor23] ERROR org.hibernate.util.JDBCExceptionReporter - Data truncation: Data too long for column 'EXCEPTION_' at row 1
              01:54:05,734 ERROR WSCreerDemande:137 - error when processing creerDemande : org.jbpm.graph.def.DelegationException: could not insert: [org.jbpm.graph.log.ActionLog]
              org.jbpm.graph.def.DelegationException: could not insert: [org.jbpm.graph.log.ActionLog]


              • 4. Re: Is mail blocking?
                kukeltje

                 

                Ok it seems my ActionHandler was wrong.


                Would be nice (for others to learn if they encounter the same issue) to report what was wrong

                But now another problem. It seems jBPM wants to log the exception in the database, and that tjis exception is too long for mysql column :

                106375 [http-8080-Processor23] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 22001
                106375 [http-8080-Processor23] ERROR org.hibernate.util.JDBCExceptionReporter - Data truncation: Data too long for column 'EXCEPTION_' at row 1
                01:54:05,734 ERROR WSCreerDemande:137 - error when processing creerDemande : org.jbpm.graph.def.DelegationException: could not insert: [org.jbpm.graph.log.ActionLog]
                org.jbpm.graph.def.DelegationException: could not insert: [org.jbpm.graph.log.ActionLog]


                Oracle right?

                Two things:
                - Post more info on your environment (db, jbpm version etc) and search the forum/wiki first
                - New issues belong in new topics

                • 5. Re: Is mail blocking?
                  kukeltje

                  Sorry, MySQL I see it now... hmm... still it belongs in a new topic... ;-)

                  • 6. Re: Is mail blocking?
                    frinux

                    You're right.
                    First, my ActionHandler was a simple class, which did not implement the ActionHandler interface. That was the problem

                    Here is a simple one:

                    import org.jbpm.graph.def.ActionHandler;
                    import org.jbpm.graph.exe.ExecutionContext;
                    
                    public class InvalidEmailAddressExceptionHandler implements ActionHandler {
                    
                     private static final long serialVersionUID = 1L;
                    
                     public void execute(ExecutionContext executionContext) {
                    
                     System.out.println("wrong email"); //FIXME crash when insertion of log into database
                    
                     }
                    
                    }


                    Now, the other issue has been posted in a new topic : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229030#4229030