Discussion:
[jboss-user] [jBPM] - Task notifications in jBPM 5.3
Aadav N
2013-05-21 11:28:30 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/818615#818615

--------------------------------------------------------------
Hi,


Can someone help me with the links leading to examples of Task Notifications. Especially my case is to code/configure task notification to trigger reminder e-mails for multiple tasks(virtual) created by Multiple Instances node.

Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/818615#818615]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Ashish T
2013-06-07 10:28:07 UTC
Permalink
Ashish T [https://community.jboss.org/people/ashpcs] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/821920#821920

--------------------------------------------------------------
+Hi Aadav,+

+I am assuminng you need it for Human task.+
+JBPM 5.4 has on exit action where you write a script which end an email.+
+
++On entry and on exit actions+: Action scripts that are executed upon entry and exit of this node, respectively.


Other option is to add email task for sending email after the human whcih can be done by programatically as well.

Thanks,
Ashish
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/821920#821920]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-07-26 06:19:53 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/829903#829903

--------------------------------------------------------------
Hi Ashish,

Thank you, Yes it is for human task only. But I need to send a reminder to the approvers when the task reaches the set expiry deadline. How can I achieve that?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829903#829903]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-07-26 07:51:44 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/829922#829922

--------------------------------------------------------------
this sounds like perfect fit for user task deadlines, see http://docs.jboss.org/jbpm/v5.3/userguide/ch.human-tasks.html#d0e4934 docuemntation for more details.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829922#829922]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-07-26 07:52:57 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/829923#829923

--------------------------------------------------------------
One more http://mswiderski.blogspot.se/2012/06/self-managable-user-tasks-notification.html link that might be useful
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829923#829923]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-07-26 10:03:17 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/829953#829953

--------------------------------------------------------------
Hi Maciej,


Thank you very much.. let me read through.. But my only challenge is I've kept my Human Task node inside a Multi Instances construct.



Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829953#829953]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-07-26 14:00:02 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/829988#829988

--------------------------------------------------------------
Hi Maciejs,

As per the documentation I've configured the human task to have expiry period and other user info. Since I've kept the human task node with in a multiple instances construct I've configured the variables that goes with the MI collection item.

Now I need to send my own custom email when the deadline is reached. so do I need to write my own listener? As per the documentation I understand that once the email server configuration is done the reminder emails will be triggered..But in my case already I've written down all the method with my own email templates (velocity templates), I just need to invoke the email method from any listener class If I can have.


Thanks,
Ravi
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829988#829988]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-07-29 05:33:49 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/830151#830151

--------------------------------------------------------------
I see two options here:
* you can define notification body as process variable so it will be resolved at runtime, then you would need to set the process variables for example by invoking some service just before the user task is triggered
* you would need to extend the http://docs.jboss.org/jbpm/v5.3/javadocs/org/jbpm/task/service/DefaultEscalatedDeadlineHandler.html DefaultEscalatedDeadlineHandler to override the executeEmailNotification method to do your custom email processing
HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/830151#830151]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-07-29 10:52:58 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/830237#830237

--------------------------------------------------------------
Hi Maciejs,

Every input of yours is always helpful. Thank you very much. I'll proceed further and will ping you on IRC If I have any doubts.

Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/830237#830237]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-07-31 07:39:25 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/830643#830643

--------------------------------------------------------------
Hi Maciejs,

I've updated my comments on https://issues.jboss.org/browse/JBPM-4078 https://issues.jboss.org/browse/JBPM-4078 when you get sometime can you please have a look into it..?

Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/830643#830643]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-07-31 10:44:30 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/830697#830697

--------------------------------------------------------------
Hi Maciejs,

I've updated my comments on https://issues.jboss.org/browse/JBPM-4078 https://issues.jboss.org/browse/JBPM-4078 when you get sometime can you please have a look into it..?

Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/830697#830697]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Aadav N
2013-08-01 02:08:19 UTC
Permalink
Aadav N [https://community.jboss.org/people/aadav86] created the discussion

"Re: Task notifications in jBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/830810#830810

--------------------------------------------------------------
Hi Maciejs,


So now the deadlines are created at the database end. And at the scheduled time when the services are attempting to run we get an exception like this.

2013-07-30 20:13:13,823 ERROR [org.jbpm.task.service.persistence.TaskPersistenceManager] (pool-20-thread-1) Unable to rollback transaction (or to mark as 'to rollback')!
java.lang.NullPointerException
          at org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)
          at org.jbpm.task.service.persistence.TaskJTATransactionManager.rollback(TaskJTATransactionManager.java:51)
          at org.jbpm.task.service.persistence.TaskPersistenceManager.rollBackTransaction(TaskPersistenceManager.java:97)
          at org.jbpm.task.service.TaskServiceSession.executeEscalatedDeadline(TaskServiceSession.java:1055)
          at org.jbpm.task.service.TaskService.executeEscalatedDeadline(TaskService.java:221)
          at org.jbpm.task.service.TaskService$ScheduledTaskDeadline.call(TaskService.java:359)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
2013-07-30 20:13:13,823 ERROR [org.jbpm.task.service.TaskService] (pool-20-thread-1) Could not start transaction.
java.lang.RuntimeException: Could not start transaction.
          at org.jbpm.task.service.TaskServiceSession.executeEscalatedDeadline(TaskServiceSession.java:1062)
          at org.jbpm.task.service.TaskService.executeEscalatedDeadline(TaskService.java:221)
          at org.jbpm.task.service.TaskService$ScheduledTaskDeadline.call(TaskService.java:359)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
          at org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)
          at org.jbpm.task.service.persistence.TaskJTATransactionManager.getStatus(TaskJTATransactionManager.java:63)
          at org.jbpm.task.service.persistence.TaskJTATransactionManager.begin(TaskJTATransactionManager.java:36)
          at org.jbpm.task.service.persistence.TaskPersistenceManager.beginTransaction(TaskPersistenceManager.java:79)
          at org.jbpm.task.service.TaskServiceSession.executeEscalatedDeadline(TaskServiceSession.java:1036)
          ... 9 more
2013-07-30 20:13:14,204 ERROR [org.jbpm.task.service.persistence.TaskPersistenceManager] (pool-21-thread-1) Unable to rollback transaction (or to mark as 'to rollback')!
java.lang.NullPointerException
          at org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)
          at org.jbpm.task.service.persistence.TaskJTATransactionManager.rollback(TaskJTATransactionManager.java:51)
          at org.jbpm.task.service.persistence.TaskPersistenceManager.rollBackTransaction(TaskPersistenceManager.java:97)
          at org.jbpm.task.service.TaskServiceSession.executeEscalatedDeadline(TaskServiceSession.java:1055)
          at org.jbpm.task.service.TaskService.executeEscalatedDeadline(TaskService.java:221)
          at org.jbpm.task.service.TaskService$ScheduledTaskDeadline.call(TaskService.java:359)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
2013-07-30 20:13:14,204 ERROR [org.jbpm.task.service.TaskService] (pool-21-thread-1) Could not start transaction.
java.lang.RuntimeException: Could not start transaction.
          at org.jbpm.task.service.TaskServiceSession.executeEscalatedDeadline(TaskServiceSession.java:1062)
          at org.jbpm.task.service.TaskService.executeEscalatedDeadline(TaskService.java:221)
          at org.jbpm.task.service.TaskService$ScheduledTaskDeadline.call(TaskService.java:359)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
          at org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)
          at org.jbpm.task.service.persistence.TaskJTATransactionManager.getStatus(TaskJTATransactionManager.java:63)
          at org.jbpm.task.service.persistence.TaskJTATransactionManager.begin(TaskJTATransactionManager.java:36)
          at org.jbpm.task.service.persistence.TaskPersistenceManager.beginTransaction(TaskPersistenceManager.java:79)
          at org.jbpm.task.service.TaskServiceSession.executeEscalatedDeadline(TaskServiceSession.java:1036)
          ... 9 more

FYI, for now to make this piece work I'm just using DefaultEscalatedDeadlineHandler only. Not extending any custom handler. can you please let me know what am I missing here

Thanks,
Aadav
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/830810#830810]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...