<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Miso,<br>
      <br>
      the problem is primarily in this line:<br>
      <br>
      QName USER_INTERNSHIP_QNAME = new QName(NS_FOO, "internship",
      "extension");<br>
      <br>
      because what is required, is not simply a QName, but a two-name
      item path (extension/internship). You have to use new
      ItemPath(...) constructor to create the path. Arguments are either
      QNames or (when there is no ambiguity) simple strings.<br>
      <br>
      This code works - note that I've put the code into
      <subjectExpression> just as an example. Tested with 'piracy'
      sample - changes names to match your situation.<br>
      <br>
      <notificationConfiguration><br>
            <handler><br>
               <simpleUserNotifier><br>
                  <subjectExpression><br>
                     <script><br>
                        <code><br>
                          import javax.xml.namespace.QName<br>
                          import
      com.evolveum.midpoint.prism.path.ItemPath<br>
                          import
      com.evolveum.midpoint.prism.delta.ObjectDelta<br>
                          import
      com.evolveum.midpoint.notifications.api.events.ModelEvent<br>
                          <br>
                          NS_FOO = '<a class="moz-txt-link-freetext" href="http://whatever.com/my">http://whatever.com/my</a>'<br>
                          INTERNSHIP_NAME = 'shipName'<br>
                          INTERNSHIP_PATH = new ItemPath('extension',
      INTERNSHIP_NAME)<br>
                          <br>
                          delta = ((ModelEvent)
      event).getSummarizedFocusDeltas()<br>
                          <br>
                         
      log.info("delta.findPropertyDelta(INTERNSHIP_PATH) != null    " +
      (delta.findPropertyDelta(INTERNSHIP_PATH)!=null))<br>
                          if
      (delta.findPropertyDelta(INTERNSHIP_PATH)!=null) {<br>
                             
      log.info("internship="+basic.getExtensionPropertyValue(requestee,
      NS_FOO, INTERNSHIP_NAME))<br>
                          }<br>
                          <br>
                          'abcdef'<br>
                        </code><br>
                     </script><br>
                  </subjectExpression><br>
                  <transport>mail</transport><br>
               </simpleUserNotifier><br>
            </handler><br>
            <mail><br>
               <debug>false</debug><br>
              
<redirectToFile>d:\midpoint\home\mail-notifications.log</redirectToFile><br>
            </mail><br>
         </notificationConfiguration><br>
      <br>
      Best regards,<br>
      Pavol<br>
      <br>
      On 3. 5. 2015 15:52, Steklac Michal wrote:<br>
    </div>
    <blockquote cite="mid:1430661131.14853.0.camel@steky" type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="GENERATOR" content="GtkHTML/4.6.6">
      Hi,<br>
      <br>
      I made an example in which obtains the value of the attribute
      family name and attribute internship. Attribute value family name
      received. When I trying to get the value for attribute internship,
      then I get null.<br>
      <br>
----------------------------------------------------------------------<br>
      * code to get family name<br>
      ...<br>
      def NS_FOO = '<a moz-do-not-send="true"
        href="http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd%27;">http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd';</a><br>
      delta = ObjectDelta.summarize(((ModelEvent)
      event).getUserDeltas()); <br>
      if(delta != null){<br>
      log.info("delta = " + delta.toString());<br>
      QName USER_FAMILYNAME_QNAME = new QName(NS_FOO,"familyName");<br>
      if(delta.findPropertyDelta(USER_FAMILYNAME_QNAME)!=null){<br>
      log.info("familyname="+requestee.getFamilyName());    <br>
      }<br>
      }<br>
      ...<br>
      * output<br>
      ...<br>
      2015-05-03 15:24:43,391 [RESOURCEOBJECTCHANGELISTENER]
      [midPointScheduler_Worker-5] INFO
      (com.evolveum.midpoint.expression): delta =
      ObjectDelta(UserType:cbd8aee0-802e-43ef-a1c7-30cb79c811f0,MODIFY:
      Property<br>
      Delta( / fullName, REPLACE), PropertyDelta( / familyName,
      REPLACE), PropertyDelta(metadata /
      {.../common/common-3}modifyChannel, REPLACE),
      PropertyDelta(metadata / {.../common/common-3}modifyTimestamp,
      REPLA<br>
      CE), ReferenceDelta(metadata / {.../common/common-3}modifierRef,
      REPLACE))<br>
      2015-05-03 15:24:43,397 [RESOURCEOBJECTCHANGELISTENER]
      [midPointScheduler_Worker-5] INFO
      (com.evolveum.midpoint.expression): familyname=Malá<br>
      ...<br>
----------------------------------------------------------------------<br>
      <br>
----------------------------------------------------------------------<br>
      * code to get intership, which is extension attribute<br>
      ...<br>
      def NS_FOO = '<a moz-do-not-send="true"
        href="http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd%27;">http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd';</a><br>
      delta = ObjectDelta.summarize(((ModelEvent)
      event).getUserDeltas()); <br>
      if(delta != null){<br>
      log.info("delta = " + delta.toString());<br>
      QName USER_INTERNSHIP_QNAME = new QName(NS_FOO, "internship",
      "extension");<br>
      log.info("delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null   
      " +
      (delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null).toString());<br>
      if(delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null){<br>
      log.info("internship="+basic.getExtensionPropertyValue(requestee,
      '<a moz-do-not-send="true" href="http://evolveum.com/my%27,">http://evolveum.com/my',</a>
      'internship'));
      <br>
      }<br>
      }<br>
      ...                    <br>
      * output<br>
      ...<br>
      2015-05-03 15:32:57,490 [RESOURCEOBJECTCHANGELISTENER]
      [midPointScheduler_Worker-4] INFO
      (com.evolveum.midpoint.expression): delta =
      ObjectDelta(UserType:cbd8aee0-802e-43ef-a1c7-30cb79c811f0,MODIFY:
      Property<br>
      Delta(extension / internship, REPLACE), PropertyDelta(metadata /
      {.../common/common-3}modifyChannel, REPLACE),
      PropertyDelta(metadata / {.../common/common-3}modifyTimestamp,
      REPLACE), ReferenceDelta(metadata<br>
      / {.../common/common-3}modifierRef, REPLACE))<br>
      2015-05-03 15:32:57,491 [RESOURCEOBJECTCHANGELISTENER]
      [midPointScheduler_Worker-4] INFO
      (com.evolveum.midpoint.expression):
      delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null    false<br>
      ...<br>
----------------------------------------------------------------------<br>
      <br>
      Please tell me what I'm doing wrong.<br>
      <br>
      Thanks,<br>
      Miso<br>
      <br>
      On So, 2015-05-02 at 20:51 +0000, Steklac Michal wrote:<br>
      <blockquote type="CITE">Hi,<br>
        <br>
        i have extend schema with attribute internship. It is possible
        get their value in notification.<br>
        <br>
        This works for me for attribute givenName<br>
        ...<br>
        QName USER_GIVENNAME_QNAME = new QName(NS_FOO,"givenName");<br>
            if(delta.findPropertyDelta(USER_GIVENNAME_QNAME)!=null){<br>
            attr = attr+'\nmeno='+requestee.getGivenName(); <br>
        }<br>
        ...<br>
        <br>
        Thanks<br>
        MiSo<br>
      </blockquote>
      <br>
      <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>