<HTML><HEAD>
<STYLE id=eMClientCss>BLOCKQUOTE.cite {
        PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px
}
BLOCKQUOTE.cite2 {
        MARGIN-TOP: 3px; PADDING-TOP: 0px; PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px
}
.plain PRE {
        FONT-SIZE: 100%; FONT-FAMILY: monospace; FONT-WEIGHT: normal; FONT-STYLE: normal
}
.plain TT {
        FONT-SIZE: 100%; FONT-FAMILY: monospace; FONT-WEIGHT: normal; FONT-STYLE: normal
}
A IMG {
        BORDER-TOP: 0px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px
}
#x454486c7b152426fba41c2731bf5606a #x4896a918a79743079569d047d86973a0 {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
#x4896a918a79743079569d047d86973a0 {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
#x68e8301635364e4c93d0741d1b01b973 {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
#x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
#x895827aeab1f42bbbaa6e68de2a7647b #x4896a918a79743079569d047d86973a0 {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
#xb91cc98f19b044e98423450ae345ebd7 {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
.plain PRE {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
.plain TT {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
BODY {
        FONT-SIZE: 12pt; FONT-FAMILY: Tahoma
}
</STYLE>

<STYLE>#x68e8301635364e4c93d0741d1b01b973 BLOCKQUOTE.cite2
{MARGIN-TOP: 3px; PADDING-TOP: 0px; PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px}
#x68e8301635364e4c93d0741d1b01b973 .plain PRE, #x68e8301635364e4c93d0741d1b01b973 .plain TT
{FONT-SIZE: 100%; FONT-FAMILY: monospace; FONT-WEIGHT: normal; FONT-STYLE: normal}
#x68e8301635364e4c93d0741d1b01b973 A IMG
{BORDER-TOP: 0px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px}
#x68e8301635364e4c93d0741d1b01b973 #xb91cc98f19b044e98423450ae345ebd7, #x68e8301635364e4c93d0741d1b01b973 .plain PRE, #x68e8301635364e4c93d0741d1b01b973 .plain TT, #x68e8301635364e4c93d0741d1b01b973
{FONT-SIZE: 12pt; FONT-FAMILY: Tahoma}
#x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 BLOCKQUOTE.cite2, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf BLOCKQUOTE.cite2
{MARGIN-TOP: 3px; PADDING-TOP: 0px; PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px}
#x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain PRE, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain TT, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf .plain PRE, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf .plain TT
{FONT-SIZE: 100%; FONT-FAMILY: monospace; FONT-WEIGHT: normal; FONT-STYLE: normal}
#x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 A IMG, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf A IMG
{BORDER-TOP: 0px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px}
#x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain PRE, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain TT, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf .plain PRE, #x68e8301635364e4c93d0741d1b01b973 #x2cc747d0139c451cbb53860f8b96fdaf .plain TT
{FONT-SIZE: 12pt; FONT-FAMILY: Tahoma}
</STYLE>
</HEAD>
<BODY bgColor=#ffffff scroll=auto class>
<DIV>Hi Pavol,</DIV>
<DIV>I am sorry.</DIV>
<DIV> </DIV>
<DIV>Goal: If attribute <SPAN id=x895827aeab1f42bbbaa6e68de2a7647b style="BACKGROUND-COLOR: #ffffff"><SPAN id=x4896a918a79743079569d047d86973a0 style="BACKGROUND-COLOR: #ffffff">$user/extension/currentADDisplayName</SPAN></SPAN> is changed, then search user with the same <SPAN id=x454486c7b152426fba41c2731bf5606a style="BACKGROUND-COLOR: #ffffff"><SPAN id=x4896a918a79743079569d047d86973a0 style="BACKGROUND-COLOR: #ffffff">currentADDisplayName attribute value - only with new value, not with old/removed value </SPAN></SPAN>(duplicity); If found, then throw exeption, else save new value.</DIV>
<DIV> </DIV>
<DIV>Problem: This code is always performed, even if the attribute <SPAN id=x4896a918a79743079569d047d86973a0 style="BACKGROUND-COLOR: #ffffff">$user/extension/currentADDisplayName</SPAN> does not change.</DIV>
<DIV> </DIV>
<DIV>My suggestion: Check, if <SPAN id=xf9a9252b540a477e86f53f1d04903120 style="BACKGROUND-COLOR: #ffffff">$user/extension/currentADDisplayName currently changing. It is OK?</SPAN></DIV>
<DIV><SPAN style="BACKGROUND-COLOR: #ffffff"></SPAN> </DIV>
<DIV><SPAN style="BACKGROUND-COLOR: #ffffff">PS: It is some way to show some "alert window" in groovy similar to javascript alert window?</SPAN></DIV>
<DIV> </DIV>
<DIV>     <mapping><BR>      <name>AD Display Name</name><BR>      <strength>normal</strength><BR>      <source><BR>         <c:path>$user/name</c:path><BR>      </source><BR>      <source><BR>         <c:path>$user/extension/currentADDisplayName</c:path><BR>      </source><BR>      <expression><BR>         <script><BR>           <relativityMode>relative</relativityMode><BR>           <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language><BR>            <code><BR>            import java.text.Normalizer;<BR>            import javax.xml.namespace.QName;<BR>            import com.evolveum.midpoint.prism.query.ObjectQuery;<BR>            import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType;<BR>            import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;<BR>            import com.evolveum.midpoint.prism.query.EqualFilter;<BR>            import com.evolveum.midpoint.prism.query.AndFilter;<BR>            import com.evolveum.midpoint.prism.query.NotFilter;<BR>            import com.evolveum.midpoint.prism.path.ItemPath;<BR>            import com.evolveum.midpoint.prism.PrismConstants;<BR>            import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;<BR>            import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;<BR>            import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;<BR>            import com.evolveum.prism.xml.ns._public.types_3.ObjectReferenceType;<BR>            import com.evolveum.midpoint.schema.SelectorOptions;<BR>            import com.evolveum.midpoint.schema.GetOperationOptions;<BR>            import com.evolveum.midpoint.model.api.PolicyViolationException;<BR>            import com.evolveum.midpoint.prism.polystring.PolyString;<BR>            <BR>            // vyhledat duplicitu na currentADDisplayName<BR>            // ------------ needs to be edited -----------------<BR>            searchAttrName = "currentADDisplayName";     // name of attribute to search<BR>            searchAttrValue = currentADDisplayName;      // value of attribute to search (filled from definition in "source" path above)<BR>            searchAttrUserName = "name";     // name of attribute to search<BR>            searchAttrUserValue = name;      // value of attribute to search (filled from definition in "source" path above)<BR>            // ------------ needs to be edited (END) -----------------    <BR>            <BR>            boolean isNew = com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew();</DIV>
<DIV> </DIV>
<DIV>            if (isNew &amp;&amp; !basic.isEmpty(searchAttrValue)) {<BR>                def filters = [];          <BR>                filters.add(NotFilter.createNot(EqualFilter.createEqual(new ItemPath(new QName(searchAttrUserName)), user.asPrismObject().getDefinition().findPropertyDefinition(new QName(searchAttrUserName)), null, searchAttrUserValue)));<BR>                filters.add(EqualFilter.createEqual(new ItemPath(new ItemPath(PrismConstants.EXTENSION_LOCAL_NAME), new QName('http://ami.cz/xml/ns/userExtension', searchAttrName)), user.asPrismObject().getExtension().getDefinition().findPropertyDefinition(new QName(searchAttrName)), null, new String(searchAttrValue)));<BR>                filter = AndFilter.createAnd(filters);<BR>                // use midPoint Library method "searchObjects"<BR>                allUsers = midpoint.searchObjects(UserType.class, ObjectQuery.createObjectQuery(filter));<BR>                if (allUsers.size() &gt; 0 ) {<BR>                   allUsers.each {<BR>                        throw new com.evolveum.midpoint.model.api.PolicyViolationException('&gt;&gt;&gt;&gt;&gt; Duplicitní AD Display Name ' + currentADDisplayName + ', toto Display Name má již uživatel ' + it?.getName() + '. &lt;&lt;&lt;&lt;&lt;');<BR>                    }<BR>                } else {<BR>                    return currentADDisplayName;<BR>                }<BR>            }<BR>                </code><BR>         </script><BR>      </expression><BR>      <target><BR>         <c:path>$user/extension/currentADDisplayName</c:path><BR>      </target><BR>      <condition><BR>        <script><BR>            <code>!basic.isEmpty(basic.stringify(currentADDisplayName))</code><BR>        </script><BR>      </condition><BR>      <evaluationPhase>afterAssignments</evaluationPhase><BR>   </mapping><BR></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV>Roman Pudil</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV id=signature_old>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Tahoma">
<TABLE style="WHITE-SPACE: normal; WORD-SPACING: 0px; BORDER-COLLAPSE: collapse; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: medium 'Times New Roman'; WIDOWS: 1; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">
<TBODY>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial, sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)" colSpan=2>
<P><SPAN style="FONT-SIZE: 14px; FONT-WEIGHT: bold">Roman Pudil</SPAN><BR>solution architect<BR><BR>gsm: [+420] 775 663 666<BR>e-mail:<SPAN class=Apple-converted-space> </SPAN><A href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial, sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)">
<P>AMI Praha a.s.<BR>Pláničkova 11<BR>162 00 Praha 6<BR>tel./fax: [+420] 274 783 239<BR>web:<SPAN class=Apple-converted-space> </SPAN><A href="http://www.ami.cz/">www.ami.cz</A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial, sans-serif; COLOR: rgb(0,0,0)">
<P><IMG title="AMI Praha a.s." border=0 alt="" src="http://www.ami.cz/images/podpis/ami_logo.gif"></P></TD></TR>
<TR>
<TD colSpan=8><BR><A href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management"><IMG border=0 alt="" src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png"></A></TD></TR>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial, sans-serif; COLOR: rgb(128,128,128)" colSpan=8><BR>Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<BR>jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.</TD></TR></TBODY></TABLE></DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>------ Původní zpráva ------</DIV>
<DIV>Od: "Pavol Mederly" <<A href="mailto:mederly@evolveum.com">mederly@evolveum.com</A>></DIV>
<DIV>Komu: <A href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</A></DIV>
<DIV>Odesláno: 12.4.2016 6:35:59</DIV>
<DIV>Předmět: Re: [midPoint] catch delta events in template</DIV>
<DIV> </DIV>
<DIV id=x68e8301635364e4c93d0741d1b01b973 style="COLOR: #000000">
<BLOCKQUOTE class=cite2 cite=570C7B2F.3040008@evolveum.com type="cite">Hello Roman,<BR><BR>I'm not sure I understand what you're trying to achieve.<BR><BR>Do you want to do something like this?<BR><BR>" IF attribute X was changed <BR>    THEN do something with attribute Y ?"<BR><BR>Could you provide a more specific description, please?<BR><BR>Best regards,<BR>Pavol<BR><BR><BR>
<DIV class=moz-cite-prefix>On 11.04.2016 16:21, Roman Pudil - AMI Praha a.s. wrote:<BR></DIV>
<BLOCKQUOTE class=cite cite=mid:em2fee4dcb-2fc1-43ce-886c-4348354f7db8@rpudil-dell7440 type="cite">
<STYLE><![CDATA[#x2cc747d0139c451cbb53860f8b96fdaf BLOCKQUOTE.cite
{PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px}
#x2cc747d0139c451cbb53860f8b96fdaf BLOCKQUOTE.cite2
{MARGIN-TOP: 3px; PADDING-TOP: 0px; PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px}
#x2cc747d0139c451cbb53860f8b96fdaf .plain PRE, #x2cc747d0139c451cbb53860f8b96fdaf .plain TT
{FONT-SIZE: 100%; FONT-FAMILY: monospace; FONT-WEIGHT: normal; FONT-STYLE: normal}
#x2cc747d0139c451cbb53860f8b96fdaf A IMG
{BORDER-TOP: 0px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px}
#x2cc747d0139c451cbb53860f8b96fdaf .plain PRE, #x2cc747d0139c451cbb53860f8b96fdaf .plain TT, #x2cc747d0139c451cbb53860f8b96fdaf
{FONT-SIZE: 12pt; FONT-FAMILY: Tahoma}
#x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 BLOCKQUOTE.cite2
{MARGIN-TOP: 3px; PADDING-TOP: 0px; PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-RIGHT: 0px; MARGIN-RIGHT: 0px}
#x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain PRE, #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain TT
{FONT-SIZE: 100%; FONT-FAMILY: monospace; FONT-WEIGHT: normal; FONT-STYLE: normal}
#x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 A IMG
{BORDER-TOP: 0px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px}
#x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0, #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain PRE, #x2cc747d0139c451cbb53860f8b96fdaf #x8c9c3951f6534f5383f55258201cf7e0 .plain TT
{FONT-SIZE: 12pt; FONT-FAMILY: Tahoma}
]]></STYLE>

<DIV><SPAN id=xb91cc98f19b044e98423450ae345ebd7>
<DIV>Hi Ivan,</DIV>
<DIV>once more: </DIV>
<DIV>How to get (or check) in user template, that current attribute is changing? How to do it? Some code about deltas?</DIV>
<DIV> </DIV>
<DIV>Your script about "isNew" variable (see later) evaluates attribute every time when user object is changed (without changing this attribute).</DIV>
<DIV> </DIV>
<DIV>Thanks!</DIV>
<DIV>Regards</DIV></SPAN></DIV>
<DIV> </DIV>
<DIV id=signature_old>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Tahoma">
<TABLE style="WHITE-SPACE: normal; WORD-SPACING: 0px; BORDER-COLLAPSE: collapse; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: medium 'Times New Roman'; WIDOWS: 1; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">
<TBODY>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                   sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)" colSpan=2>
<P><SPAN style="FONT-SIZE: 14px; FONT-WEIGHT: bold">Roman Pudil</SPAN><BR>solution architect<BR><BR>gsm: [+420] 775 663 666<BR>e-mail:<SPAN class=Apple-converted-space> </SPAN><A href="mailto:roman.pudil@ami.cz" moz-do-not-send="true"><A class=moz-txt-link-abbreviated href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</A></A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                   sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)">
<P>AMI Praha a.s.<BR>Pláničkova 11<BR>162 00 Praha 6<BR>tel./fax: [+420] 274 783 239<BR>web:<SPAN class=Apple-converted-space> </SPAN><A href="http://www.ami.cz/" moz-do-not-send="true"><A class=moz-txt-link-abbreviated href="http://www.ami.cz/">www.ami.cz</A></A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                   sans-serif; COLOR: rgb(0,0,0)">
<P><IMG title="AMI Praha a.s." border=0 alt="" src="http://www.ami.cz/images/podpis/ami_logo.gif" moz-do-not-send="true"></P></TD></TR>
<TR>
<TD colSpan=8><BR><A href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management" moz-do-not-send="true"><IMG border=0 alt="" src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png" moz-do-not-send="true"></A></TD></TR>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                   sans-serif; COLOR: rgb(128,128,128)" colSpan=8><BR>Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<BR>jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.</TD></TR></TBODY></TABLE></DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>------ Původní zpráva ------</DIV>
<DIV>Od: "Roman Pudil - AMI Praha a.s." <<A href="mailto:roman.pudil@ami.cz" moz-do-not-send="true"><A class=moz-txt-link-abbreviated href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</A></A>></DIV>
<DIV>Komu: "midPoint General Discussion" <<A href="mailto:midpoint@lists.evolveum.com" moz-do-not-send="true"><A class=moz-txt-link-abbreviated href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</A></A>></DIV>
<DIV>Odesláno: 7.4.2016 13:15:00</DIV>
<DIV>Předmět: Re[2]: [midPoint] catch delta events in template</DIV>
<DIV> </DIV>
<DIV id=x2cc747d0139c451cbb53860f8b96fdaf class=class>
<BLOCKQUOTE class=cite2 cite=em862fed24-2083-418e-88e8-e9b601d77936@rpudil-dell7440 type="cite">
<DIV>Thanks! This works!</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV id=signature_old>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Tahoma">
<TABLE style="WHITE-SPACE: normal; WORD-SPACING: 0px; BORDER-COLLAPSE: collapse; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: medium 'Times New Roman'; WIDOWS: 1; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">
<TBODY>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                       sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)" colSpan=2>
<P><SPAN style="FONT-SIZE: 14px; FONT-WEIGHT: bold">Roman Pudil</SPAN><BR>solution architect<BR><BR>gsm: [+420] 775 663 666<BR>e-mail:<SPAN class=Apple-converted-space> </SPAN><A href="mailto:roman.pudil@ami.cz" moz-do-not-send="true"><A class=moz-txt-link-abbreviated href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</A></A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                       sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)">
<P>AMI Praha a.s.<BR>Pláničkova 11<BR>162 00 Praha 6<BR>tel./fax: [+420] 274 783 239<BR>web:<SPAN class=Apple-converted-space> </SPAN><A href="http://www.ami.cz/" moz-do-not-send="true"><A class=moz-txt-link-freetext href="http://www.ami.cz/">http://www.ami.cz/</A></A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                       sans-serif; COLOR: rgb(0,0,0)">
<P><IMG title="AMI Praha                           a.s." border=0 alt="" src="http://www.ami.cz/images/podpis/ami_logo.gif" moz-do-not-send="true"></P></TD></TR>
<TR>
<TD colSpan=8><BR><A href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management" moz-do-not-send="true"><IMG border=0 alt="" src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png" moz-do-not-send="true"></A></TD></TR>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,                       sans-serif; COLOR: rgb(128,128,128)" colSpan=8><BR>Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<BR>jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.</TD></TR></TBODY></TABLE></DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>------ Původní zpráva ------</DIV>
<DIV>Od: "Ivan Noris" <<A href="mailto:ivan.noris@evolveum.com" moz-do-not-send="true">ivan.noris@evolveum.com</A>></DIV>
<DIV>Komu: <A href="mailto:midpoint@lists.evolveum.com" moz-do-not-send="true">midpoint@lists.evolveum.com</A></DIV>
<DIV>Odesláno: 7.4.2016 11:51:30</DIV>
<DIV>Předmět: Re: [midPoint] catch delta events in template</DIV>
<DIV> </DIV>
<DIV id=x8c9c3951f6534f5383f55258201cf7e0 style="COLOR: #000000">
<BLOCKQUOTE class=cite2 cite=57062DA2.80400@evolveum.com type="cite">Hi Roman,<BR><BR>I was using this in user template to copy each change of emailAddress attribute, i.e. only new addresses entered there, to extended attribute allMailAddresses (to keep all previous addresses):<BR><BR>    <mapping><BR>        <name>copy emailAddress on change</name><BR>        <source><BR>            <path>$user/employeeType</path><BR>        </source><BR>        <source><BR>            <path>$user/emailAddress</path><BR>        </source><BR>        <expression><BR>        <script><BR>            <code><BR>boolean isNew = com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluationContext.getThreadLocal().isEvaluateNew()<BR>if (isNew &amp;&amp; !basic.isEmpty(emailAddress)) return emailAddress<BR>            </code><BR>        </script><BR>    </expression><BR>        <target><BR>            <path>$user/extension/allMailAddresses</path><BR>        </target><BR>        <condition><BR>             <script><BR>                <code>employeeType == 'EMP' || employeeType == 'EXT'</code><BR>            </script>  <BR>        </condition><BR>        <evaluationPhase>afterAssignments</evaluationPhase><BR>    </mapping><BR><BR>Regards,<BR>Ivan<BR><BR><BR>
<DIV class=moz-cite-prefix>On 04/07/2016 11:45 AM, Roman Pudil - AMI Praha a.s. wrote:<BR></DIV>
<BLOCKQUOTE class=cite cite=mid:emcbb807f8-a21f-42f3-a8a9-e142b442a30a@rpudil-dell7440 type="cite">
<DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>how to catch delta events in user template (similar "events" objects in notifications)?</DIV>
<DIV> </DIV>
<DIV>Situation - example:</DIV>
<OL>
<LI>
<DIV>User has familyName = "oldFamilyName"</DIV></LI>
<LI>
<DIV>Helpdesk Operator change familyname (in GUI) from "oldFamilyName" to "newFamilyName"</DIV></LI>
<LI>
<DIV>I need catch (probably in User Template?) ONLY new value "newFamilyName" and operate with this.</DIV></LI></OL>
<DIV>Thanks!</DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV> </DIV>
<DIV>Roman Pudil</DIV>
<DIV> </DIV>
<DIV id=signature_old>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Tahoma">
<TABLE style="WHITE-SPACE: normal; WORD-SPACING: 0px; BORDER-COLLAPSE: collapse; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: medium 'Times New                       Roman'; WIDOWS: 1; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">
<TBODY>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,  sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)" colSpan=2>
<P><SPAN style="FONT-SIZE: 14px; FONT-WEIGHT: bold">Roman Pudil</SPAN><BR>solution architect<BR><BR>gsm: [+420] 775 663 666<BR>e-mail:<SPAN class=Apple-converted-space> </SPAN><A class=moz-txt-link-abbreviated href="mailto:roman.pudil@ami.cz" moz-do-not-send="true"><A class=moz-txt-link-abbreviated href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</A></A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,  sans-serif; VERTICAL-ALIGN: bottom; COLOR: rgb(0,0,0)">
<P>AMI Praha a.s.<BR>Pláničkova 11<BR>162 00 Praha 6<BR>tel./fax: [+420] 274 783 239<BR>web:<SPAN class=Apple-converted-space> </SPAN><A class=moz-txt-link-abbreviated href="http://www.ami.cz/" moz-do-not-send="true"><A class=moz-txt-link-freetext href="http://www.ami.cz/">http://www.ami.cz/</A></A></P></TD>
<TD style="BORDER-RIGHT: rgb(204,204,204) 1px solid">   </TD>
<TD>   </TD>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,  sans-serif; COLOR: rgb(0,0,0)">
<P><IMG title="AMI Praha a.s." border=0 alt="" src="http://www.ami.cz/images/podpis/ami_logo.gif" moz-do-not-send="true"></P></TD></TR>
<TR>
<TD colSpan=8><BR><A href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management" moz-do-not-send="true"><IMG border=0 alt="" src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png" moz-do-not-send="true"></A></TD></TR>
<TR>
<TD style="FONT-SIZE: 11px; FONT-FAMILY: Arial,  sans-serif; COLOR: rgb(128,128,128)" colSpan=8><BR>Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<BR>jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.</TD></TR></TBODY></TABLE></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" moz-do-not-send="true">midPoint@lists.evolveum.com</A>
<A class=moz-txt-link-freetext href="http://lists.evolveum.com/mailman/listinfo/midpoint" moz-do-not-send="true">http://lists.evolveum.com/mailman/listinfo/midpoint</A>
</PRE></BLOCKQUOTE><BR><PRE class=moz-signature cols="72">-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer & IDM Architect
  evolveum.com                     evolveum.com/blog/
  ___________________________________________________
  "Semper ID(e)M Vix."
</PRE></BLOCKQUOTE></DIV></BLOCKQUOTE></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></BLOCKQUOTE></DIV></BODY></HTML>