[midPoint] Dynamically Auto-assign Relations

Chak Hon Lam chakhon at hawaii.edu
Thu Mar 9 00:45:15 CET 2023


Hi,
Does anyone know how to dynamically auto-assign Relations? I’ve been trying
to assign relations automatically using inbound mapping and
assignmentTargetSearch but my current implementation is very rigid:

<inbound>
   <strength>strong</strength>
   <expression>
       <assignmentTargetSearch>
           <targetType>OrgType</targetType>
           <filter>
               <q:equal>
                   <q:path>identifier</q:path>
                   <expression>
                       <script>
                           <code>
                               String jobStr = basic.stringify(input)
                               def tokenizedStr = jobStr.split(',')

                               if (tokenizedStr[1] == "faculty") {
                                   return tokenizedStr[0].toLowerCase()
                               }
                           </code>
                       </script>
                   </expression>
               </q:equal>
           </filter>
           <assignmentProperties>
               <relation>relation:faculty</relation>
           </assignmentProperties>
       </assignmentTargetSearch>
   </expression>
   <target>
       <path>assignment</path>
   </target>
</inbound>

Suppose I have 4 different relations and I want to assign relations to the
user depending on the 2nd part of the user's job string but the code above
only works for the relation faculties. Is there a way of doing this without
having to copy-paste the code 3 more times, each time with a different
relation?

Many thanks and best regards,
Chak Hon Lam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20230308/382d1208/attachment-0001.htm>


More information about the midPoint mailing list