[midPoint] Role/Service autoassignment
Chris Woods
Chris.Woods at rohde-schwarz.com
Sat Sep 14 11:02:28 CEST 2019
Hi everyone,
I'm probably thinking about this completely the wrong way, but here goes anyway:
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".
All is working well - A service for each card in the card database was created with the appropriate archetype.
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.
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).
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:
<autoassign>
<enabled>true</enabled>
<focus>
<mapping>
<name>Badge autoassign</name>
<strength>strong</strength>
<source>
<path>$focus/name</path> <-- the employeeID of the user -->
</source>
<source>
<path>$this/extension/rsBadgeAssignee</path> <-- trying to reference rsBadgeAssignee in service itself -->
</source>
<condition>
<script>
<code>basic.stringify(name).equals(rsBadgeAssignee)</code>
</script>
</condition>
</mapping>
</focus>
</autoassign>
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?
I hope all this was not too confusing and appreciate any help!
Regards,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190914/10e5a3c5/attachment.htm>
More information about the midPoint
mailing list