This Spring event is published by
ProcessManager
for abandoned
ProcessStatus
instances it finds. Listeners for this event have
an opportunity to perform some operation, presumably to cleanup state, or perhaps resume a partially completed operation.
Listeners should have a short lifecycle and either quickly perform operations, or spawn an asynchronous thread of execution,
as it is undesirable to tie up the scheduled job threads from ProcessManager with long running executions.
This event will be published for many different types of ProcessStatus instances. Listeners should qualify themselves
in their onApplicationEvent method against the ProcessStatus (see
getProcessStatus()
) before proceeding. This is
usually accomplished by checking the
ProcessStatus.getExecutionType()
.
Listeners should implement the
HandleAbandonedProcessEventListener
interface.
Should one or more listeners qualified for a particular ProcessStatus fail, or throw an exception, the ProcessManager
will not automatically try to re-attempt handling for the ProcessStatus. However, a listener does have access to the
ProcessStatus (see
getProcessStatus()
) and may un-archive the ProcessStatus, which would cause the system
to try to re-attempt handling. However, listener implementations should carefully consider such a choice if there
are other listeners for the same ProcessStatus type, as this would possibly cause those other listeners to re-execute,
which may not be desirable and could lead to unanticipated state.