[Fix] Archive activity after toExecution() if state is executed
This commit is contained in:
parent
ed2526ec95
commit
ffe6b8abdc
|
@ -334,12 +334,25 @@ public class EventBasedExecutionHandler extends ExecutionHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecuteActivityCommand command = new ExecuteActivityCommand(getContainer(), tx);
|
if (activity.getState().isExecuted()) {
|
||||||
command.setActivity(activity);
|
|
||||||
command.validate();
|
|
||||||
command.doCommand();
|
|
||||||
|
|
||||||
tx.commitOnClose();
|
synchronized (this.registeredActivities) {
|
||||||
|
if (!this.registeredActivities.removeElement(realm, activityLoc))
|
||||||
|
logger.warn("Activity " + activityLoc + " already removed from registered activities!");
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Archiving activity " + activityLoc + " with state " + activity.getState());
|
||||||
|
archiveActivity(realm, activity.getLocator());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
ExecuteActivityCommand command = new ExecuteActivityCommand(getContainer(), tx);
|
||||||
|
command.setActivity(activity);
|
||||||
|
command.validate();
|
||||||
|
command.doCommand();
|
||||||
|
|
||||||
|
tx.commitOnClose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue