<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<div dir="auto">
<div dir="auto">Hi Arnost, </div><div dir="auto"><br></div><div dir="auto">Many thanks for the reply. I will try that today :) </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Chris</div><div dir='auto'><br></div>
<div id="aqm-original" style="color: black;">
<!-- body start -->
<div class="aqm-original-body">
<div style="color: black;">
<p style="color: black; font-size: 10pt; font-family: sans-serif; margin: 8pt 0;">Am 16. September 2019 10:13:43 schrieb "Arnošt Starosta - AMI Praha a.s." <arnost.starosta@ami.cz>:</p>
<blockquote type="cite" class="gmail_quote" style="margin: 0 0 0 0.75ex; border-left: 1px solid #808080; padding-left: 0.75ex;">
<div dir="ltr">Hi Chris,<div><br></div><div>you can intercept the extension/rsBadgeAssignee change in a hook and based on it's old and new values find the two employees and explicitly recompute just them. With your assignment in user template this will do the job. I would try a final hook for the service type.</div><div><br></div><div>And as the recompute may fail, you want to make sure to recompute the failed users in the future - either recompute all of them once in a while or run a specialized task to find badges assigned to wrong employees etc.</div><div><br></div><div>I don't believe there is other way to do this right now, but please anybody proove me wrong.</div><div><br></div><div>The autoassignment wont help you, the users must still be recomputed and it comes with a performace price on top. But when i need to access the attributes of both roles and focus objects in assignments, i use the assignmentPath and related variables, see midpoint wiki.</div><div><br></div><div>arnost</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">so 14. 9. 2019 v 11:02 odesílatel Chris Woods <<a href="mailto:Chris.Woods@rohde-schwarz.com" target="_blank">Chris.Woods@rohde-schwarz.com</a>> napsal:<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 lang="DE">
<div class="m_-7117259782126524313m_-7698814065786528674gmail-m_-2630579181631049824WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi everyone,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m probably thinking about this completely the wrong way, but here goes anyway:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have a company ID card system that we originally had setup so that when reconciling, the badge would appear as  a projection for the user (when the employeeID for the badge matched the $focus/name of the user). However,
 we now have a requirement to store more data about the badge than the id card system provides, so I modified the synchronisation setup to create a FocusType of Service. This service is assigned an archetype “Company ID card”.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">All is working well – A service for each card in the card database was created with the appropriate archetype.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">However, I can’t seem to find a way to automatically assign the service to the user based on the employeeID which is now stored in the service as extension/rsBadgeAssignee.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried to do the assignment in the User object template, which worked – as long as I actually opened the user and recomputed them. Day cards are transferred from person to person, so I don’t want to have to update 14,000
 Users, just because one card has transferred ownership. If I just modified the rsBadgeAssignee in the card service object, nothing happened to either the previous owner (removal) or the new owner (assignment).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I then tried autoassign in the archetype. All the examples for autoassignment use some kind of constant like ‘internal’ or ‘FTE’ to be present in the focal object (user). What I couldn’t work out how to do was something
 like this:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127);background:rgb(212,212,212)">autoassign</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">  
            </span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">        </span><span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">enabled</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">true</span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">enabled</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">        </span><span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">focus</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">            </span><span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">mapping</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">               </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">name</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">Badge
 autoassign</span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">name</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">               </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">strength</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">strong</span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">strength</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">               </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">source</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                    </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">path</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">$focus/name</span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">path</span><span lang="EN-US" style="font-family:Consolas;color:teal">>
 <-- the employeeID of the user --> </span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                </span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">source</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">   
</span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                </span><span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">source</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                   </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">path</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">$this/extension/rsBadgeAssignee</span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">path</span><span lang="EN-US" style="font-family:Consolas;color:teal">>   
 <-- trying to reference rsBadgeAssignee in service itself –-></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">source</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">          
</span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                </span><span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">condition</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                    </span>
<span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">script</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                       
</span><span lang="EN-US" style="font-family:Consolas;color:teal"><</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">code</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas;color:black">basic.stringify(name).equals(rsBadgeAssignee)</span><span lang="EN-US" style="font-family:Consolas;color:teal"></</span><span lang="EN-US" style="font-family:Consolas;color:rgb(63,127,127)">code</span><span lang="EN-US" style="font-family:Consolas;color:teal">></span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span lang="EN-US" style="font-family:Consolas;color:black">                    </span>
<span style="font-family:Consolas;color:teal"></</span><span style="font-family:Consolas;color:rgb(63,127,127)">script</span><span style="font-family:Consolas;color:teal">></span><span style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span style="font-family:Consolas;color:black">                </span><span style="font-family:Consolas;color:teal"></</span><span style="font-family:Consolas;color:rgb(63,127,127)">condition</span><span style="font-family:Consolas;color:teal">></span><span style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span style="font-family:Consolas;color:black">            </span><span style="font-family:Consolas;color:teal"></</span><span style="font-family:Consolas;color:rgb(63,127,127)">mapping</span><span style="font-family:Consolas;color:teal">></span><span style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">
<span style="font-family:Consolas;color:black">        </span><span style="font-family:Consolas;color:teal"></</span><span style="font-family:Consolas;color:rgb(63,127,127)">focus</span><span style="font-family:Consolas;color:teal">></span><span style="font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas;color:black">    </span><span style="font-family:Consolas;color:teal"></</span><span style="font-family:Consolas;color:rgb(63,127,127);background:rgb(212,212,212)">autoassign</span><span style="font-family:Consolas;color:teal">><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">This throws an error, because there is no rsBadgeAsignee attribute in the focus (User), but how do I reference “this” (i.e. the service itself) in the condition?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I hope all this was not too confusing and appreciate any help!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Chris</span><span lang="EN-US" style="font-family:Consolas;color:teal"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>

_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-7117259782126524313m_-7698814065786528674gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13px"><p><strong>Arnošt Starosta</strong><br><span style="font-size:11px;color:rgb(128,128,128)">solution architect</span></p></div><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px">gsm: [+420] 603 794 932<br>e‑mail: <a href="mailto:arnost.starosta@ami.cz" target="_blank">arnost.starosta@ami.cz</a></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px"><strong>AMI Praha a.s.</strong><br>Pláničkova 11, 162 00 Praha 6</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px">tel.: [+420] 274 783 239 | web: <a href="https://www.ami.cz" target="_blank">www.ami.cz</a></p><p style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;margin-top:20px"><img src="http://www.ami.cz/images/podpis/ami_logo.gif" alt="AMI Praha a.s." style="border:0px"></p><p style="font-family:Arial,sans-serif;font-size:11px;color:rgb(170,170,170)">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.<br><span style="font-size:6px"> </span><br>Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může obsahovat důvěrné nebo osobní<br>informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv zveřejňování, zprostředkování<br>nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail neoprávněně, informujte o tom prosím<br>odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně všech jeho příloh. Nakládáním<br>s neoprávněně získanými informacemi se vystavujete riziku právního postihu.</p></div></div></div></div></div>

<div>_______________________________________________</div>
<div>midPoint mailing list</div>
<div><a class="aqm-autolink aqm-autowrap" href="mailto:midPoint%40lists.evolveum.com">midPoint@lists.evolveum.com</a></div>
<div><a class="aqm-autolink aqm-autowrap" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a></div>
</blockquote>
</div>
</div>
<!-- body end -->

</div><div dir="auto"><br></div>
</div></body>
</html>