<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Ubuntu;
panose-1:2 11 5 4 3 6 2 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.DefaultFontHxMailStyle
{mso-style-name:"Default Font HxMail Style";
font-family:"Ubuntu",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span class=DefaultFontHxMailStyle><i>*</i></span><span class=DefaultFontHxMailStyle><i> only if the resource isn’t assigned?<o:p></o:p></i></span></p><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:jeverling@bshp.edu">Jason Everling</a><br><b>Sent: </b>Thursday, July 2, 2020 1:04 PM<br><b>To: </b><a href="mailto:midpoint@lists.evolveum.com">midPoint General Discussion</a><br><b>Subject: </b>RE: [midPoint] How to blank out user properties?</p></div><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><p class=MsoNormal><span class=DefaultFontHxMailStyle>What about just a regular mapping in the default user template with a condition strong that gets applied and only if the resource is assigned?<o:p></o:p></span></p><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:9.6pt'><mapping><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <description>Clean out department</description><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <strength>strong</strength><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <source><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <path>$user/assignments</path><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </source><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <target><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <path>$user/extension/ndsuPrimaryJobTitle</path><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </target><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <expression><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <script><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <code><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> if (assignment != your resource) {<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> return null;<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> }<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </code><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </script><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </expression><o:p></o:p></p><p class=MsoNormal></mapping><span class=DefaultFontHxMailStyle><o:p></o:p></span></p><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From: </b><a href="mailto:richard.frovarp@ndsu.edu">Richard Frovarp</a><br><b>Sent: </b>Thursday, July 2, 2020 12:56 PM<br><b>To: </b><a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a><br><b>Subject: </b>Re: [midPoint] How to blank out user properties?<o:p></o:p></p></div><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><div><p class=MsoNormal>I've seen your archive example. I wasn't completely clear. I don't want to archive the old value. I just want it gone. I want to keep the user object though. So if I were to leave NDSU, we would want there to still be the name, employee number, etc to remain. But my title would no longer apply. A bigger deal if I were to become a student, we wouldn't want my job title applied to my AD object for instance as it wouldn't be applicable. Just trying to get the value back to null.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>On Thu, 2020-07-02 at 12:22 -0500, Jason Everling wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #729FCF 1.5pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><p class=MsoNormal style='margin-left:9.6pt'><span class=DefaultFontHxMailStyle>So what I can read from, you want to archive the old value? We do this for various attributes when they are changed, see here, I had added it to the midpoint samples a while back, it will take the old value which was previously set and then add it to a custom schema attribute for archival history, such as a username change, level change, affiliation, etc..<o:p></o:p></span></p><p class=MsoNormal style='margin-left:9.6pt'><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:9.6pt'><a href="https://github.com/evolveum/midpoint-samples/blob/master/samples/contrib/bshp/objects/objectTemplates/Includes%20-%20Archiving.xml">https://github.com/evolveum/midpoint-samples/blob/master/samples/contrib/bshp/objects/objectTemplates/Includes%20-%20Archiving.xml</a><span class=DefaultFontHxMailStyle><o:p></o:p></span></p><p class=MsoNormal style='margin-left:9.6pt'><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:9.6pt'><b>From: </b><a href="mailto:richard.frovarp@ndsu.edu">Richard Frovarp</a><br><b>Sent: </b>Thursday, July 2, 2020 11:13 AM<br><b>Subject: </b>[midPoint] How to blank out user properties?<o:p></o:p></p></div><p class=MsoNormal style='margin-left:9.6pt'><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:9.6pt'>I'm reading a list of our employees from a DB through a<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>DatabaseTableConnector resource. As part of that process I'm setting a<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>custom schema element that is their title. That's fine. However, when<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>they are no longer employed, they disappear from the database table.<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'>So I'm trying to blank out the title property, since if they aren't<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>employed anymore, they don't have a title. We want to keep historic<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>records, and they may still be a student, which we wouldn't populate a<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>title.<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'>How does one go about doing this? It was suggested using an object<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>template on the deleted situation, but that doesn't appear to be<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>working.<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'>Resource:<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'><reaction><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <situation>deleted</situation><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <synchronize>true</synchronize><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <action><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>-3#unlink</handlerUri>;<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </action><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <objectTemplateRef oid="5b23b0d3-0740-47a1-932d-c5a4ab513bc4" /><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'></reaction><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'>User Template:<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'><mapping><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <description>Clean out department</description><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <strength>strong</strength><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <target><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <path>$user/extension/ndsuPrimaryJobTitle</path><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </target><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <expression><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <script><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> <code>null</code><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </script><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'> </expression><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'></mapping><o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'>No errors are thrown, it's just that the title element remains populate<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>with the last know value when the user is deleted from the resource.<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:9.6pt'>Thanks,<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>Richard<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>_______________________________________________<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>midPoint mailing list<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>midPoint@lists.evolveum.com<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'>https://lists.evolveum.com/mailman/listinfo/midpoint<o:p></o:p></p><p class=MsoNormal style='margin-left:9.6pt'><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><pre>_______________________________________________</pre><pre>midPoint mailing list</pre><pre><a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a></pre><pre><a href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a></pre></blockquote><pre style='margin-left:4.8pt'><o:p> </o:p></pre><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p><p class=MsoNormal><span class=DefaultFontHxMailStyle><o:p> </o:p></span></p></div></body></html>