This mechanism is used to notify users about relevant changes in midPoint and/or connected resources. For example, a user (or user's boss, or the person who requested the operation, the security manager, etc) may be notified when one of user's accounts is created, modified, or removed. Or, when the midPoint user record is created, when the password is changed, or when he has a new work item to process. There are many such situations imaginable.
Currently there are three basic kinds of notifications:
- User notifications. These are related to midPoint user record, e.g. its creation, modification or removal.
- Account notifications. These are related to accounts on resources, e.g. creation, modification, or removal of such an account.
- Workflow notifications. These are generated e.g. when a work item is created or completed, or when a workflow process instance is started or finished.
Some simple examples
Configuration of notifications is currently done within SystemConfiguration object (see the schema in SVN trunk). Some examples are shown below:
A bit of theory
When something that is potentially of interest occurs, an event is generated. This event is then processed by one or more event handlers, as prescribed in <notificationConfiguration> section.
Event handler can be one of the following:
- A notifier - i.e. a module that transforms an event to zero, one or more notifications. Examples are:
- simpleUserNotifier (generates notifications about user records),
- simpleAccountNotifier (notifies about accounts),
- userPasswordNotifier, accountPasswordNotifier (specialized notifiers that prepare messages about user/account passwords),
- workItemNotifier (notifications about start/completion of a work item),
- workflowNotifier (the same for workflow process instances),
- and generalNotifier (general purpose notifier that is driven by expressions that transform an event into a notification).
- A filter - does not generate notifications, but passes (and filters) defined subsets of notifications. A filter can be defined in relation to a notifier - in that case it defines, which classes of events get processed by that notifier. Or a filter can be part of a handler chain (see below). Examples of filters:
- categoryFilter - passes one or more defined categories of events: account-related events, user-related events, work item-related events, workflow-related events;
- statusFilter - passes or filters events based on their status: success, failure, in-progress. Please note that user-related events are currently only with status = success (failures are not transformed into events). In workflow related events, success means approval, failure means refusal;
- operationFilter - passes or filters events based on the kind of operation that was executed or attempted to: add, modify, or delete;
- expressionFilter - a generic filter that evaluates an expression and passes/filters event based on the result.
- A handler chain - contains sequentially ordered event handlers (notifiers, filters, forks, other chains). Processing within a chain continues until an event is filtered out. (Please note that filtering is done only by filters; all notifiers simply pass all events along.)
- A fork - splits processing of an event into more handlers "in parallel". (We expect this kind of handler will be used only occassionally.)
Handlers defined at the level of <notificationConfiguration> are executed in parallel.