<div dir="ltr">Hi,<div>I'm trying to build a two-level structure in Midpoint.<br><br>As a resource I use a table in RDBMS.<br>The table is connected to the midpoint using a DatabaseTableConnector.</div><div><br></div><div>In the table, the data is denormalized and multiple entities can be defined there.<br></div><div><br></div><div>   contract_id   |   organization  | user_id | firstname | lastname  |    fullname                  <br>---------------------------------------------------------------------------------------------------------------<br> 1                     | Rome               | 032       | Gnaeus   | Pompeius | Gnaeus Pompeius     <br> 2                     | Optimates        | 032       | Gnaeus   | Pompeius | Gnaeus Pompeius         <br> 3                     | Rome               | 028       | Gaius      | Julius        | Gaius Julius Caesar         <br> 4                     | Populares        | 028       | Gaius      | Julius        | Gaius Julius Caesar           <br></div><div><br></div><div>I'm trying to achieve a structure similar to the following:<br>User (key - userId) one -> many Contract (key - contract_Id).</div><div><br></div><div>I decided that the Personas functionality is the best way to create this relationship.<br></div><div><br></div><div>Plan: When a user (physical) is imported, persons (contracts) should be created for each contract_id.<br><br>Further, the contract data synchronized with other systems.<br></div><div>Thus a user (physical) is only needed to link together contracts related to the same user.</div><div>After import created physical user and only one<b> </b>persona. User(physical) have only one value in extension/contractId.</div><div>A user has only one extension/contractId value and only one persona is created.</div><div><br></div><div>Can I achieve the desired effect with personas? <br>e.g. create a separate objectClass for contracts and then use the midpoint library to look for a physical user, then link them to each other with personRef.<br></div><div>Or should I use a more appropriate functionality?</div><div><br></div><div>Thank you in advance,<br></div><div>Khangai<br></div><div><br></div><div><br></div><div><div>ObjectTemplate for personas-contracts:</div><div><pre style="white-space:pre-wrap;color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><<span style="color:rgb(0,51,179)">item</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>name</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">mapping</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>extension/contractId</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>name</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>        <<span style="color:rgb(0,51,179)">expression</span>><br>            <<span style="color:rgb(0,51,179)">script</span>><br>                <<span style="color:rgb(0,51,179)">code</span>>'contract-' + contractId + '-'+  name</<span style="color:rgb(0,51,179)">code</span>><br>            </<span style="color:rgb(0,51,179)">script</span>><br>        </<span style="color:rgb(0,51,179)">expression</span>><br>    </<span style="color:rgb(0,51,179)">mapping</span>><br></<span style="color:rgb(0,51,179)">item</span>><br><br><<span style="color:rgb(0,51,179)">item</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>extension/contractId</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">mapping</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>extension/contractId</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">mapping</span>><br></<span style="color:rgb(0,51,179)">item</span>><br><br><<span style="color:rgb(0,51,179)">item</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>extension/cardNumber</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">mapping</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>extension/cardNumber</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">mapping</span>><br></<span style="color:rgb(0,51,179)">item</span>></pre></div></div><div><br></div><div>My resource mappings:</div><div><pre style="white-space:pre-wrap;color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><<span style="color:rgb(0,51,179)">attribute</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>icfs:uid</<span style="color:rgb(0,51,179)">ref</span>> <span style="color:rgb(140,140,140);font-style:italic"><!--This is user_id column--><br></span>    <<span style="color:rgb(0,51,179)">outbound</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/name</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">outbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/name</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">expression</span>><br>            <<span style="color:rgb(0,51,179)">value</span>><br>                <<span style="color:rgb(0,51,179)">targetRef </span><span style="color:rgb(23,74,212)">oid</span><span style="color:rgb(6,125,23)">="ca4ee9dd-6b08-48e7-a596-332bd49cb938" </span><span style="color:rgb(23,74,212)">type</span><span style="color:rgb(6,125,23)">="RoleType"</span>/><br>            </<span style="color:rgb(0,51,179)">value</span>><br>        </<span style="color:rgb(0,51,179)">expression</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>assignment</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br></<span style="color:rgb(0,51,179)">attribute</span>><br><br><<span style="color:rgb(0,51,179)">attribute</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>ri:firstname</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">displayName</span>>First name</<span style="color:rgb(0,51,179)">displayName</span>><br>    <<span style="color:rgb(0,51,179)">outbound</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/givenName</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">outbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/givenName</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br></<span style="color:rgb(0,51,179)">attribute</span>><br><br><<span style="color:rgb(0,51,179)">attribute</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>ri:lastname</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">displayName</span>>Last name</<span style="color:rgb(0,51,179)">displayName</span>><br>    <<span style="color:rgb(0,51,179)">outbound</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/familyName</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">outbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/familyName</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br></<span style="color:rgb(0,51,179)">attribute</span>><br><br><<span style="color:rgb(0,51,179)">attribute</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>ri:fullname</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">outbound</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/fullName</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">outbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/fullName</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br></<span style="color:rgb(0,51,179)">attribute</span>><br><br><<span style="color:rgb(0,51,179)">attribute</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>ri:contract_id</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">outbound</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/extension/contractId</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">outbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/extension/contractId</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br></<span style="color:rgb(0,51,179)">attribute</span>><br><br><<span style="color:rgb(0,51,179)">attribute</span>><br>    <<span style="color:rgb(0,51,179)">ref</span>>ri:card_number</<span style="color:rgb(0,51,179)">ref</span>><br>    <<span style="color:rgb(0,51,179)">outbound</span>><br>        <<span style="color:rgb(0,51,179)">source</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/extension/cardNumber</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">source</span>><br>    </<span style="color:rgb(0,51,179)">outbound</span>><br>    <<span style="color:rgb(0,51,179)">inbound</span>><br>        <<span style="color:rgb(0,51,179)">target</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$focus/extension/cardNumber</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">target</span>><br>    </<span style="color:rgb(0,51,179)">inbound</span>><br></<span style="color:rgb(0,51,179)">attribute</span>></pre><pre style="white-space:pre-wrap;color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">Correlation in synchronization:</div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal"><pre style="white-space:pre-wrap;color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><<span style="color:rgb(0,51,179)">correlation</span>><br>    <<span style="color:rgb(135,16,148)">q</span><span style="color:rgb(0,51,179)">:equal</span>><br>        <<span style="color:rgb(135,16,148)">q</span><span style="color:rgb(0,51,179)">:path</span>>c:name</<span style="color:rgb(135,16,148)">q</span><span style="color:rgb(0,51,179)">:path</span>><br>        <<span style="color:rgb(0,51,179)">expression</span>><br>            <<span style="color:rgb(0,51,179)">path</span>>$projection/attributes/uid</<span style="color:rgb(0,51,179)">path</span>><br>        </<span style="color:rgb(0,51,179)">expression</span>><br>    </<span style="color:rgb(135,16,148)">q</span><span style="color:rgb(0,51,179)">:equal</span>><br></<span style="color:rgb(0,51,179)">correlation</span>></pre></div></pre></div></div>