5 Replies Latest reply on Feb 18, 2011 1:04 AM by rohya

    Send notifications for unassigned tasks in jBPM 4

    rapa
      Hi,
      I am using jBPM 4.4 with Seam 2.2, running on JBoss 4.2.
      I couldn't find anything in the user guide nor examples on internet for this quite standard situation:
      I would like to send a notification for newly created tasks, which are not yet assigned.
      This is not very useful since I would like to notify users from an assignable group that a task

      Hi,

       

      I am using jBPM 4.4 with Seam 2.2, running on JBoss 4.2.

       

      I couldn't find anything in the user guide nor examples on internet for this quite standard situation:

       

      I would like to send a notification for newly created tasks, which are not yet assigned.

      It seems like jBPM sends notifications only when tasks are assigned to someone. This is not very useful in my case since I would like to notify users from an assignable group that a task is pending. One of them should then take it and work on it.

       

       

      Here is the task definition.

       

          <task candidate-groups="managers" g="243,49,127,52" name="Review Registration">
              <notification template="jbpm_approvepartreg_task" />      
              <transition name="approve" to="State 1" g="7,-11" />
              <transition name="reject" to="State 2" g="-13,8" />
          </task>
      

       

      And the email template. Basically, the email should go out to the "tos" specified in the email template.

       

       

          <mail-template name="jbpm_approvepartreg_task">
              <from addresses="jbpm@mydomain.com" />
              <to addresses="xyz@mydomain.com" />
              <subject>Pending Task Notification - ${task.name}</subject>
              <text>Some text here</text>
          </mail-template>
      

       

       

      Anybody has an idea how to deal with this problem?

       

      Cheers,

      Andrea

        • 1. Re: Send notifications for unassigned tasks in jBPM 4
          mwohlf

          Hi rapa,

          maybe using a mail node in your process definition is an option for you?

          see: http://docs.jboss.org/jbpm/v4/userguide/html_single/#mail

          • 2. Re: Send notifications for unassigned tasks in jBPM 4
            rapa

            Hi Michael,

             

            I don't think this is a solution. Well technically it is, but I don't want to start creating mail nodes to manage my notification.

             

            I actually found out in the meantime that what I would like to do is achievable with a reminder instead of a notification, by setting a very short first reminder, e.g. 15 seconds. It's kind of silly as it doesn't allow me to specify different messages for a notification and a reminder, but I could live with it:

             

              <task candidate-groups="managers" g="243,49,127,52" name="Review Registration">
                    <reminder duedate="15 seconds" repeat="2 days" template="jbpm_approvepartreg_task" />      
                    <transition name="approve" to="State 1" g="7,-11" />
                    <transition name="reject" to="State 2" g="-13,8" />
              </task>

             

            If nobody has a better solution I will use this one. Thanks for your answer anyway.

             

            Cheers,

            Andrea

            • 3. Re: Send notifications for unassigned tasks in jBPM 4
              mwohlf

              wow that's strange that "reminder" works but "notification" doesn't,

              I would say "file a Jira for this" but I don't think anyone cares about jBPM4's Jira anymore...

              • 4. Re: Send notifications for unassigned tasks in jBPM 4
                rapa

                That might be a typical example of bug, which in my case turns out to be useful

                The fact is that, regarding task notifications, the manual states:

                It is possible to provide assignees with notifications when a task is added to their list

                 

                That means that no mechanism is though for notify unassigned tasks (kind of funny for me...). Question is: is the reminder supposed to work only for assigned tasks as well (and that would be a bug)?

                 

                I think that the real "bug" is that notifications should not be sent ONLY when tasks are assigned...

                • 5. Send notifications for unassigned tasks in jBPM 4
                  rohya

                  hello Sir,

                   

                  Please send me setting which i have to do for sending mail.

                  I am getting following error

                   

                  org.jbpm.api.JbpmException: could not send email: javax.mail.internet.MimeMessage@2f60ce

                    at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:60)

                    at org.jbpm.jpdl.internal.activity.MailActivity.perform(MailActivity.java:44)

                    at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)

                    at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)

                    at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)

                    at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:616)

                    at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:217)

                    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:65)

                    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38)

                    at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

                    at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)

                    at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

                    at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

                    at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)

                    at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

                    at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:66)

                    at myPack.myController.startProcess1(myController.java:94)

                    at myPack.myController.doAfterCompose(myController.java:40)

                    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:712)

                    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:658)

                    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:602)

                    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:569)

                    at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:369)

                    at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:291)

                    at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:243)

                    at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:164)

                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                    at java.lang.Thread.run(Thread.java:619)

                  Caused by: javax.mail.SendFailedException: Invalid Addresses;

                    nested exception is:

                    com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for rohit.wadke@productivityparadigms.com