[midPoint] - Notification to user when new projection is set

Pavol Mederly mederly at evolveum.com
Tue Nov 15 20:54:02 CET 2016


Hello Rodrigo,

is it quite easy. An example:

<notificationConfiguration>
   <handler>
     <expressionFilter>
       <script>
         <code>
           import com.evolveum.midpoint.notifications.api.events.*

           if (!(event instanceof ResourceObjectEvent)) {
             return false
           }
           return 
basic.stringify(event.getResourceName()).contains("OpenDJ")
         </code>
       </script>
     </expressionFilter>
     <simpleResourceObjectNotifier>
       <transport>mail</transport>
     </simpleResourceObjectNotifier>
   </handler>
   .....
</notificationConfiguration>

Please see https://wiki.evolveum.com/display/midPoint/Notifications and 
https://wiki.evolveum.com/display/midPoint/Configuring+notifications. As 
for the Groovy code, you can access the /event/ variable and its 
features. For example, in case of ResourceObjectEvent (event that is 
related to resource objects, i.e. projections), you can use methods 
defined in ResourceObjectEvent 
<https://github.com/Evolveum/midpoint/blob/master/model/notifications-api/src/main/java/com/evolveum/midpoint/notifications/api/events/ResourceObjectEvent.java>, 
BaseEvent 
<https://github.com/Evolveum/midpoint/blob/master/model/notifications-api/src/main/java/com/evolveum/midpoint/notifications/api/events/BaseEvent.java>, 
and Event 
<https://github.com/Evolveum/midpoint/blob/master/model/notifications-api/src/main/java/com/evolveum/midpoint/notifications/api/events/Event.java>.

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 14.11.2016 18:32, Rodrigo Yanis wrote:
> Hello everyone,
>
> Is it possible to send a notification to the user's mail in the event 
> of a new projection beign set to it, and furthermore, only if that 
> projection complies with a regex?
>
> For example, user is assigned to resource A, and gets a projection in 
> said resource. Since I have a notification configured to be sent when 
> the user gets a new projection in "A", a new notification is sent to 
> the user.
>
> If the user gets a new projection in resource B, the user doesn't get 
> any notifications.
>
> Thanks in advance,
>
> *Rodrigo Yanis.*
> Identicum S.A.
> Jorge Newbery 3226
> Tel: +54 (11) 4824-9971
> ryanis at identicum.com <mailto:ryanis at identicum.com>
> www.identicum.com <http://www.identicum.com/>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161115/3f74fb53/attachment.htm>


More information about the midPoint mailing list