<div dir="ltr"><div dir="ltr">I guess it goes, every environment is different, just a little additions to turn it into a task, see attached, the formatting kept going screwy if I pasted. You can go in and schedule it after you import or add the schedule info to the xml.<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 7, 2020 at 2:53 PM Richard Frovarp <<a href="mailto:richard.frovarp@ndsu.edu">richard.frovarp@ndsu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="text-align:left;direction:ltr">
<div>The value wasn't being reapplied. It looks like empty strings aren't null, and I am not quite able to get null to work. I need to come up with a more elegant solution, but I was able to find something that works:</div>
<div><br>
</div>
<div><s:search xmlns:s="<a href="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/model/scripting-3</a>"</div>
<div> xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"</div>
<div> xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3" target="_blank">http://prism.evolveum.com/xml/ns/public/query-3</a>"</div>
<div> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance"></a>;</div>
<div> <s:type>UserType</s:type></div>
<div> <s:searchFilter></div>
<div> <q:greater></div>
<div> <q:path>extension/ndsuPrimaryJobDepartment</q:path></div>
<div> <q:value></q:value></div>
<div> </q:greater></div>
<div> </s:searchFilter></div>
<div> <s:action></div>
<div> <s:type>execute-script</s:type></div>
<div> <s:parameter></div>
<div> <s:name>script</s:name></div>
<div> <c:value xsi:type="ScriptExpressionEvaluatorType"></div>
<div> <c:code></div>
<div> import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType</div>
<div> import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType</div>
<div> import com.evolveum.midpoint.prism.path.ItemPath</div>
<div> </div>
<div> refs = input?.getLinkRef()</div>
<div> for (ref in refs) {</div>
<div> try {</div>
<div> shadow = midpoint.getObject(ShadowType.class, ref.getOid())</div>
<div> } catch (Exception e) {</div>
<div> <a href="http://log.info" target="_blank">log.info</a>('DEAD SHADOW {}', <a href="http://input.name" target="_blank">input.name</a>)</div>
<div> continue</div>
<div> }</div>
<div><br>
</div>
<div> if (shadow.getResourceRef().getOid() == '5f1cc34a-2b27-4ae1-9989-3960e2e311f4') {</div>
<div> return</div>
<div> }</div>
<div> }</div>
<div></div>
<div> path = ItemPath.create(UserType.F_EXTENSION, 'ndsuPrimaryJobDepartment')</div>
<div> delta = midpoint.prismContext.deltaFactory().object().createModificationDeleteProperty(UserType.class, input.getOid(), path, basic.getPropertyValue(input, "extension/ndsuPrimaryJobDepartment"))</div>
<div> midpoint.executeChanges(delta)</div>
<div><br>
</div>
<div> path = ItemPath.create(UserType.F_EXTENSION, 'ndsuPrimaryJobTitle')</div>
<div> titleDelta = midpoint.prismContext.deltaFactory().object().createModificationDeleteProperty(UserType.class, input.getOid(), path, basic.getPropertyValue(input, "extension/ndsuPrimaryJobTitle"))</div>
<div> midpoint.executeChanges(delta)</div>
<div><br>
</div>
<div> </c:code></div>
<div> </c:value></div>
<div> </s:parameter></div>
<div> </s:action></div>
<div></s:search></div>
<div><br>
</div>
<div>Feels like I'm doing things sub-optimal. Between your examples and the Grouper bits I was able to get enough figured out. Like I said, this works. They only way they disappear from the resource is on a reconcile, so having this run in a task later is fine.
I think my dead shadows are from earlier tests where I didn't get the right synchronization for removal quickly enough.</div>
<div><br>
</div>
<div>Now I need to figure out how to turn this into a bulk action task of some sort.</div>
<div><br>
</div>
<div>On Thu, 2020-07-02 at 16:58 -0500, Jason Everling wrote:</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div dir="ltr">Yep, my weekend starts here in a few! even though i've been working at home for 4 months now :D
<div><br>
</div>
<div>You could be hitting my age old bug as well, check the history tab on the user to make sure the value isn't being re-applied, I was about right, the last time we used it was 3.2 and this was reported in 3.1 when it was doing the same thing for us,</div>
<div><a href="https://jira.evolveum.com/browse/MID-2100" target="_blank">https://jira.evolveum.com/browse/MID-2100</a> </div>
<div> <br clear="all">
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Jul 2, 2020 at 4:27 PM Richard Frovarp <<a href="mailto:richard.frovarp@ndsu.edu" target="_blank">richard.frovarp@ndsu.edu</a>> wrote:<br>
</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><mapping></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <description>Clean out title</description></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <strength>strong</strength></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <target></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <path>$user/extension/ndsuPrimaryJobTitle</path></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> </target></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <expression></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <script></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> <code>null</code></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> </script></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"> </expression></span><br style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">
<span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"></mapping></span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><br>
</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">It's not clear how midPoint interprets empty strings to me. Hence using the script to do an explicit null.</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><br>
</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">I can give what you provided a try next week. I'm about to start the weekend. Thank you for the help. Thank you for providing your examples, they have been helpful to us getting
going (I just found your bulk actions item, which is helpful). Once I have something more complicated than importing names, I'll start to try to contribute back with what we have working.</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><br>
</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal">Have a great 4th!</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><br>
</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><br>
</span></div>
<div><span style="font-family:"Ubuntu Mono";font-size:17.3333px;white-space:normal"><br>
</span></div>
<div>On Thu, 2020-07-02 at 16:18 -0500, Jason Everling wrote:</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">So can you post what you have for the deleted template action? You also have that set under the resource for deleted? I just checked, and a long time ago we did something similar for accounts removed from a resource, although we don't anymore
but that was on 3.2 and should still work, i don't see why not unless its bug, try the below, i pulled from an old 'delete' template on our private repo from an old resource we had years ago
<div><br>
</div>
<div>
<div style="color:rgb(0,0,0);background-color:rgb(255,255,254);font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace;font-size:13px;line-height:18px;white-space:pre-wrap">
<div><span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">mapping</span><span style="color:rgb(0,0,255)">></span></div>
<div> <span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">authoritative</span><span style="color:rgb(0,0,255)">></span>true<span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">authoritative</span><span style="color:rgb(0,0,255)">></span></div>
<div><span style="color:rgb(0,0,255)"></span><span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">strength</span><span style="color:rgb(0,0,255)">></span>strong<span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">strength</span><span style="color:rgb(0,0,255)">></span></div>
<div> <span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">expression</span><span style="color:rgb(0,0,255)">></span></div>
<div> <span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">value></span>''<span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">value</span><span style="color:rgb(0,0,255)">></span></div>
<div> <span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">expression</span><span style="color:rgb(0,0,255)">></span></div>
<div><span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">target</span><span style="color:rgb(0,0,255)">></span></div>
<div><span style="color:rgb(0,0,255)"><</span><span style="color:rgb(128,0,0)">path</span><span style="color:rgb(0,0,255)">></span>extension/ndsuPrimaryJobTitle<span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">path</span><span style="color:rgb(0,0,255)">></span></div>
<div><span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">target</span><span style="color:rgb(0,0,255)">></span></div>
<div><span style="color:rgb(0,0,255)"></</span><span style="color:rgb(128,0,0)">mapping</span><span style="color:rgb(0,0,255)">></span></div>
</div>
</div>
<div><br clear="all">
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Jul 2, 2020 at 4:09 PM Richard Frovarp <<a href="mailto:richard.frovarp@ndsu.edu" target="_blank">richard.frovarp@ndsu.edu</a>> wrote:<br>
</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div>
<div>Thanks. I've started work down the bulk actions path. Which is perhaps less than ideal, but I think I understand it, and I will have operations later that will require it. I can follow your more elegant solution after I have something working. I don't
quite have all of the affiliations populated yet right now. I figured that setting and clearing a single value attribute from a single source would be the easiest thing to start with. Affiliations come after I have this working.</div>
<div><br>
</div>
<div>On Thu, 2020-07-02 at 15:55 -0500, Jason Everling wrote:</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div dir="ltr">:/ ive been updating some of our logstash stuff, should be != faculty and != staff<br clear="all">
<div>
<div dir="ltr">
<div dir="ltr">JASON</div>
</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Jul 2, 2020 at 3:49 PM Jason Everling <<a href="mailto:jeverling@bshp.edu" target="_blank">jeverling@bshp.edu</a>> wrote:<br>
</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div dir="ltr">Gotcha, I just put together a quick example for an idea, you can also go with if affiliation == student && not == faculty || affiliation == student && not == staff || etc...
<div><br>
</div>
<div>for the assignments, you would write the script to get all assignments then if your resource doesn't exist apply mapping, there is a midpoint function for it, we used something similar for a bulk task, ill find it on my prod git repo, its back there in
time,</div>
<div><br>
</div>
<div>someone else might be able to chime in sooner<br clear="all">
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Jul 2, 2020 at 2:13 PM Richard Frovarp <<a href="mailto:richard.frovarp@ndsu.edu" target="_blank">richard.frovarp@ndsu.edu</a>> wrote:<br>
</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div lang="EN-US">
<div>But students can be employed. I need it so that if they aren't in that resource, they are removed. You're earlier example makes some sense, but I don't have a deep enough understanding of midPoint to fully implement it. Error complains about the source
of $user/assignments. I'm on 4.1 and it looks like that may have changed some, but I can't quite figure out how.</div>
<div><br>
</div>
<div>Kind of frustrated as this seems like it should be a basic operation, and it's the one thing stopping me from going further. I don't want a mess of stale data in a brand new system a day after it goes up.
</div>
<div><br>
</div>
<div>I've been looking at queries and bulk actions, but I can't figure out how to find all users that aren't referenced by a resource. I can find all in the resource, and all that have a resource that isn't it (which is all of the users as names are pulled
in from a different resource). What is a one minute query in raw SQL is beyond my understanding here right now.</div>
<div><br>
</div>
<div>On Thu, 2020-07-02 at 13:15 -0500, Jason Everling wrote:</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div>
<p class="MsoNormal"><span>Also this in the default template, if return null; doesn’t work you could also go with return ‘’; . So many different ways to do it without relying on a deleted template<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:9.6pt"><mapping><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <description>Clean out department</description><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <strength>strong</strength><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <source><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <path>$user/extension/your_affiliation</path><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </source><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <target><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <path>$user/extension/ndsuPrimaryJobTitle</path><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </target><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <expression><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <script><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <code><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> if (affiliation == ‘student’) {<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> return null;<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> }<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </code><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </script><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </expression><u></u><u></u></p>
<p class="MsoNormal"></mapping><span><u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:jeverling@bshp.edu" target="_blank">Jason Everling</a><br>
<b>Sent: </b>Thursday, July 2, 2020 1:06 PM<br>
<b>To: </b><a href="mailto:midpoint@lists.evolveum.com" target="_blank">midPoint General Discussion</a><br>
<b>Subject: </b>RE: [midPoint] How to blank out user properties?</p>
</div>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><i>* only if the resource isn’t assigned?<u></u><u></u></i></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:jeverling@bshp.edu" target="_blank">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" target="_blank">midPoint General Discussion</a><br>
<b>Subject: </b>RE: [midPoint] How to blank out user properties?<u></u><u></u></p>
</div>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>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?<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:9.6pt"><mapping><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <description>Clean out department</description><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <strength>strong</strength><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <source><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <path>$user/assignments</path><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </source><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <target><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <path>$user/extension/ndsuPrimaryJobTitle</path><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </target><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <expression><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <script><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> <code><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> if (assignment != your resource) {<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> return null;<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> }<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </code><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </script><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:9.6pt"> </expression><u></u><u></u></p>
<p class="MsoNormal"></mapping><span><u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:richard.frovarp@ndsu.edu" target="_blank">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" target="_blank">midpoint@lists.evolveum.com</a><br>
<b>Subject: </b>Re: [midPoint] How to blank out user properties?<u></u><u></u></p>
</div>
<p class="MsoNormal"><span><u></u> <u></u></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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">On Thu, 2020-07-02 at 12:22 -0500, Jason Everling wrote:<u></u><u></u></p>
</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<p class="MsoNormal" style="margin-left:0.2in"><span>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..<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.2in"><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:0.2in"><a href="https://github.com/evolveum/midpoint-samples/blob/master/samples/contrib/bshp/objects/objectTemplates/Includes%20-%20Archiving.xml" target="_blank">https://github.com/evolveum/midpoint-samples/blob/master/samples/contrib/bshp/objects/objectTemplates/Includes%20-%20Archiving.xml</a><span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.2in"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-left:0.2in"><b>From: </b><a href="mailto:richard.frovarp@ndsu.edu" target="_blank">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?<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:0.2in"><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:0.2in">I'm reading a list of our employees from a DB through a<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">DatabaseTableConnector resource. As part of that process I'm setting a<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">custom schema element that is their title. That's fine. However, when<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">they are no longer employed, they disappear from the database table.<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">So I'm trying to blank out the title property, since if they aren't<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">employed anymore, they don't have a title. We want to keep historic<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">records, and they may still be a student, which we wouldn't populate a<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">title.<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">How does one go about doing this? It was suggested using an object<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">template on the deleted situation, but that doesn't appear to be<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">working.<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">Resource:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><reaction><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <situation>deleted</situation><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <synchronize>true</synchronize><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <action><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <handlerUri><a href="http://midpoint.evolveum.com/xml/ns/public/model/action" target="_blank">http://midpoint.evolveum.com/xml/ns/public/model/action</a><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">-3#unlink</handlerUri>;<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> </action><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <objectTemplateRef oid="5b23b0d3-0740-47a1-932d-c5a4ab513bc4" /><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"></reaction><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">User Template:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><mapping><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <description>Clean out department</description><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <strength>strong</strength><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <target><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <path>$user/extension/ndsuPrimaryJobTitle</path><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> </target><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <expression><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <script><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> <code>null</code><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> </script><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"> </expression><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"></mapping><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">No errors are thrown, it's just that the title element remains populate<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">with the last know value when the user is deleted from the resource.<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">Thanks,<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">Richard<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">_______________________________________________<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in">midPoint mailing list<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.2in"><span><u></u> <u></u></span></p>
<pre>_______________________________________________</pre>
<pre>midPoint mailing list</pre>
<pre><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a></pre>
<pre><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a></pre>
</blockquote>
<pre style="margin-left:4.8pt"><u></u> <u></u></pre>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
</div>
<pre>_______________________________________________</pre>
<pre>midPoint mailing list</pre>
<pre><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a></pre>
<pre><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a></pre>
<pre><br></pre>
</blockquote>
</div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote>
</div>
</blockquote>
</div>
<pre>_______________________________________________</pre>
<pre>midPoint mailing list</pre>
<pre><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a></pre>
<pre><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a></pre>
<pre><br></pre>
</blockquote>
</div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote>
</div>
</div>
<pre>_______________________________________________</pre>
<pre>midPoint mailing list</pre>
<pre><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a></pre>
<pre><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a></pre>
<pre><br></pre>
</blockquote>
</div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote>
</div>
<pre>_______________________________________________</pre>
<pre>midPoint mailing list</pre>
<pre><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a></pre>
<pre><a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a></pre>
<pre><br></pre>
</blockquote>
</div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div></div>