Defer email sending until transaction is commited
-------------------------------------------------
Key: JBPM-2809
URL:
https://jira.jboss.org/jira/browse/JBPM-2809
Project: jBPM
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Affects Versions: jBPM 4.x
Reporter: Peter Horvath
Currently emails are sent immediately when they are dispatched from e.g. a mail node or
task notification. This can be confusing since the transaction the JBPM execution runs in
can be rolled back later.
For example a workflow could contain an initial email node which sends a confirmation
email to the user who submitted a request ("Your request has been successfully
submitted to the workflow system...") - but if the the next node in the workflow
throws an exception which rolls back the transaction the submitted request won't be
stored in the system. This can be very confusing for the end users. There are similar
problems with task notifications as well.
I think it would be fairly easy to solve this problem by introducing an optional attribute
to the mail node which instructs JBPM to send the email only on transaction commit and
modify MailActivity so that it creates a transaction synchronization which sends the email
from javax.transaction.Synchronization.afterCompletion(int status) method if the status is
COMMITED.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira