<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello Rodrigo,</p>
    <p>is it quite easy. An example:</p>
    <p><tt><notificationConfiguration></tt><tt><br>
      </tt><tt>  <handler></tt><tt><br>
      </tt><tt>    <expressionFilter></tt><tt><br>
      </tt><tt>      <script></tt><tt><br>
      </tt><tt>        <code></tt><tt><br>
      </tt><tt>          import
        com.evolveum.midpoint.notifications.api.events.*</tt><tt><br>
      </tt><tt>                      </tt><tt><br>
      </tt><tt>          if (!(event instanceof ResourceObjectEvent)) {</tt><tt><br>
      </tt><tt>            return false</tt><tt><br>
      </tt><tt>          }</tt><tt><br>
      </tt><tt>          return
        basic.stringify(event.getResourceName()).contains("OpenDJ") </tt><tt><br>
      </tt><tt>        </code></tt><tt><br>
      </tt><tt>      </script></tt><tt><br>
      </tt><tt>    </expressionFilter></tt><tt><br>
      </tt><tt>    <simpleResourceObjectNotifier><br>
              <transport>mail</transport><br>
            </simpleResourceObjectNotifier><br>
          </handler><br>
          .....<br>
        </notificationConfiguration></tt></p>
    <p>Please see <a
        href="https://wiki.evolveum.com/display/midPoint/Notifications">https://wiki.evolveum.com/display/midPoint/Notifications</a>
      and <a
href="https://wiki.evolveum.com/display/midPoint/Configuring+notifications">https://wiki.evolveum.com/display/midPoint/Configuring+notifications</a>.
      As for the Groovy code, you can access the <i>event</i> 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 <a
href="https://github.com/Evolveum/midpoint/blob/master/model/notifications-api/src/main/java/com/evolveum/midpoint/notifications/api/events/ResourceObjectEvent.java">ResourceObjectEvent</a>,
      <a
href="https://github.com/Evolveum/midpoint/blob/master/model/notifications-api/src/main/java/com/evolveum/midpoint/notifications/api/events/BaseEvent.java">BaseEvent</a>,
      and <a
href="https://github.com/Evolveum/midpoint/blob/master/model/notifications-api/src/main/java/com/evolveum/midpoint/notifications/api/events/Event.java">Event</a>.<br>
    </p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 14.11.2016 18:32, Rodrigo Yanis
      wrote:<br>
    </div>
    <blockquote
cite="mid:CADu-59GxW_QSVs-J2cKttQrC20SMTcKHe2Zsv3tUwXXoaiLj6w@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello everyone,
        <div><br>
        </div>
        <div>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?</div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>If the user gets a new projection in resource B, the user
          doesn't get any notifications.</div>
        <div><br>
        </div>
        <div>Thanks in advance, <br clear="all">
          <div>
            <div class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr"><br>
                              </div>
                              <div dir="ltr"><font face="arial,
                                  helvetica, sans-serif"><b>Rodrigo
                                    Yanis.</b><br>
                                  <img moz-do-not-send="true"
                                    src="http://www.identicum.com/img/favicon.ico">Identicum
                                  S.A.<br>
                                </font>Jorge Newbery 3226<br>
                                Tel: +54 (11) 4824-9971<font
                                  face="arial, helvetica, sans-serif"><br>
                                  <a moz-do-not-send="true"
                                    href="mailto:ryanis@identicum.com"
                                    target="_blank"><font
                                      color="#0b5394">ryanis@identicum.com</font></a><br>
                                  <a moz-do-not-send="true"
                                    href="http://www.identicum.com/"
                                    target="_blank"><font
                                      color="#0b5394">www.identicum.com</font></a></font></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>