cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch Email Task exceptions

aparraga
Champ in-the-making
Champ in-the-making
I have a process that sends 10 emails in a loop with the email task. If the email task raises an exception for whatever reason (let say, because of a malformed email), the process ends. I want the process catch the exception and continue with the next email.

Does anybody know how to do that?

Thank you in advance
Antonio
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi,

You could write your own e-mail service task. Otherwise you'll have to raise a JIRA issue to implement this functionality in the Activiti email task.

Best regards,

sarkar92
Champ in-the-making
Champ in-the-making
is it implemented in activiti??

frederikherema1
Star Contributor
Star Contributor
This is not implemented in Activiti, however you can support this usecase by adding a single JavaDelegate that executes the loop and does a try/catch and sends the emails…

If you want to model the loop inside the process, create a multi-instance service-task with a Java-delegate that sends the mail, doing a try-catch around it to catch any errors and stop them from going up the stack…

frederikherema1
Star Contributor
Star Contributor
This is not implemented in Activiti, however you can support this usecase by adding a single JavaDelegate that executes the loop and does a try/catch and sends the emails…

If you want to model the loop inside the process, create a multi-instance service-task with a Java-delegate that sends the mail, doing a try-catch around it to catch any errors and stop them from going up the stack…

conradi
Champ in-the-making
Champ in-the-making
The recent thread http://forums.activiti.org/content/email-task-exceptions is related to your question.
There the activiti mail task is altered in such a way to not throw exceptions.