<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<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:0 0 0 .8ex; border-left:2px #729fcf solid;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" class="gmail_signature" data-smartmail="gmail_signature">
<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">jeverling@bshp.edu</a>> wrote:<br>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;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:0 0 0 .8ex; border-left:2px #729fcf solid;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:0 0 0 .8ex; border-left:2px #729fcf solid;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:0 0 0 .8ex; border-left:2px #729fcf solid;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">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>
<pre><br></pre>
</blockquote>
</body>
</html>