Page tree
Skip to end of metadata
Go to start of metadata

Task manager provides the following notifications:

Task handler execution starttask ownerEmitted when a task handler execution is started.
Task handler execution finishtask ownerEmitted when a task handler execution finishes.

Some examples

The following snippet of the system configuration object can be used to configure task notifications:

            <transport>mail</transport>      <!-- all starts and finishes are reported by mail (can generate a lot of messages, e.g. when live sync is used -->
            <operation>delete</operation>    <!-- DELETE means finishing task handler execution -->
            <status>onlyFailure</status>     <!-- this corresponds to the FATAL_ERROR result -->
            <operation>delete</operation>    <!-- DELETE means finishing task handler execution -->
                <script>                     <!-- any situation that results in the task being suspended -->
         <redirectToFile>d:\midpoint\home\mail-notifications.txt</redirectToFile>		<!-- just for debugging -->
     <sms> ... </sms> 

A notification looks like this:

============================================ Tue Jun 21 18:07:42 CEST 2016
Subject: Task 'Reconcile CSV1' finish notification: FATAL_ERROR

Notification about task-related operation.

Task: Reconcile CSV1

Run result status: PERMANENT_ERROR
Message: Reconciliation without an object class specification is not supported
Progress: 0

Notification created on: Tue Jun 21 18:07:42 CEST 2016

Task owner: midPoint Administrator (administrator)

The following information is available:

TaskThe name of the task. Usually it is self-explaining.  
HandlerHandler that starts or finishes its execution. Most tasks have exactly one handler. However, some workflow-related tasks can have more (sometimes up to 4) handlers. Each handler start/stop is sent as a standalone event.  
Run result statusResult of the handler execution, driving what will be done with the task. Can have values of PERMANENT_ERROR, TEMPORARY_ERROR, FINISHED, FINISHED_HANDLER, INTERRUPTED, RESTART_REQUESTED. (TODO - more information)Can be tested with isPermanentError(), isTemporaryError(), isFinished(), isInterrupted(), isRestartRequested() event methods. 
StatusStatus as stored in the task's operation result. Can have values of SUCCESS, HANDLED_ERROR, WARNING, PARTIAL_ERROR, FATAL_ERROR, IN_PROGRESS, NOT_APPLICABLE.Can be tested with <status> filter, or with isSuccess() - corresponds to SUCESS, HANDLED_ERROR, WARNING, isOnlyFailure() - corresponds to FATAL_ERROR, isFailure() - corresponds to PARTIAL_ERROR or FATAL_ERROR. 
MessageMessage that is part of the operation result, if present.Retrieved via event.getMessage(). 
ProgressProgress reported by the task.Retrieved via event.getProgress(). 

So, if you want to send notifications when a problem occurs, it is most advisable to use expressionFilter of event.isPermanentError(), as in the third example.


TODO more detailed explanation


  • No labels