Email Task Exceptions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2013 11:14 AM
The email task is a quite useful simple task - however, I think in it's current form it is hardly usable in a productive environment: any failure (be it a missing / invalid email address or a failure on the server side) is propagated as exception to the workflow, where it cannot be handled gracefully. <!–break–> It is possible to write a delegate for that or to write an own mail task - and we have done exactly that. More precisely, we have changed the activiti implementation by writing the error information into process variables: The workflow can then e.g. query for this process variables in a gateway.
I know the problem has been discussed here before (e.g. http://forums.activiti.org/content/how-can-i-manage-errors-generated-mailtask, in particular http://forums.activiti.org/comment/8887#comment-8887), but would nevertheless like to to ask again: How is the chance for an out of the box mail task implementation which offers more support for exception handling?
Heinz-Dieter
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2013 07:48 AM
You say that you have a custom delegate, one thing that would speed up tremendously is if you can share that through a pull request. That way, you're sure it's added quickly to the code. Of course we are here to assist with that and where everything should go etc.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2013 07:13 AM
And my post can be read as a question if it makes sense at all to send possible patches.
Unfortunately, I can't use github, but can of course give a patch which modifies the MailActivityBehavior in such a way, that no exception is thrown, but instead the error info is written into process variables (added as attachment, the patch is against 5.11, but should apply against 5.13)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2013 05:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2013 04:03 PM
[java]
throw new ActivitiException("Could not send e-mail", e);
[/java]
and adding:
[java]
logger.warn("Could not send email:" + e.getMessage());
logger.debug("", e);
[/java]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2013 10:28 AM
Best regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2014 09:40 AM
We are currently upgrading our 5.11 codebase to use the current 5.15.1 release, and I would like to get rid of the mail patch.
When speaking of 'activiti attribute' do you mean something like:
<code>
<serviceTask id="sendMail" activiti:type="mail" activiti:throwMailException="false">
</code>
or something like:
<code>
<extensionElements>
<activiti:field name="throwException" expression="false" />
</extensionElements>
</code>
But even more important, in my previous patch I wrote the information about the exception into a process variable, so that it can be used later in the workflow, e.g. by a gateway:
<java>
private void handleException(ActivityExecution execution, String msg, Exception e) {
log.log(Level.SEVERE, msg, e);
execution.setVariable("EMAIL_ERROR", Boolean.TRUE);
execution.setVariable("EMAIL_ERROR_MSG", msg);
}
</java>
Would that be acceptable?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2014 05:14 AM
The old behavior is only changed when ignoreException is explicitly activated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2014 10:01 AM
https://github.com/Activiti/Activiti/commit/4b17821b1687ed671ee71f798099f48d8abe6efb
Best regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2014 11:10 AM
