ALF-611 Correct finding of compensating action for failed scheduled actions

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30553 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-09-15 16:53:29 +00:00
parent 3eed98f84a
commit 2fdaab8c35

View File

@@ -520,12 +520,11 @@ public abstract class AbstractScheduledAction implements ScheduledActionDefiniti
// If the error triggers compensation, and they should be processed. // If the error triggers compensation, and they should be processed.
if (runCompensatingActions && (t instanceof CompensatingActionException)) if (runCompensatingActions && (t instanceof CompensatingActionException))
{ {
CompensatingActionException cae = (CompensatingActionException) t.getCause(); CompensatingActionException cae = (CompensatingActionException)t;
for (Pair<Action, NodeRef> pair : cae.getCompensatingActions()) for (Pair<Action, NodeRef> pair : cae.getCompensatingActions())
if ((pair != null) && (pair.getFirst() != null) && (pair.getSecond() != null)) if ((pair != null) && (pair.getFirst() != null) && (pair.getSecond() != null))
{ {
try try
{ {
// try the compensating action in its own tx // try the compensating action in its own tx
runTransactionalCompensatingAction(pair); runTransactionalCompensatingAction(pair);