[midPoint] multiple users/personas

K T hangaitarhaev95 at gmail.com
Mon Aug 8 11:36:33 CEST 2022


Hi,
I'm trying to build a two-level structure in Midpoint.

As a resource I use a table in RDBMS.
The table is connected to the midpoint using a DatabaseTableConnector.

In the table, the data is denormalized and multiple entities can be defined
there.

   contract_id   |   organization  | user_id | firstname | lastname  |
 fullname
---------------------------------------------------------------------------------------------------------------
 1                     | Rome               | 032       | Gnaeus   |
Pompeius | Gnaeus Pompeius
 2                     | Optimates        | 032       | Gnaeus   |
Pompeius | Gnaeus Pompeius
 3                     | Rome               | 028       | Gaius      |
Julius        | Gaius Julius Caesar
 4                     | Populares        | 028       | Gaius      |
Julius        | Gaius Julius Caesar

I'm trying to achieve a structure similar to the following:
User (key - userId) one -> many Contract (key - contract_Id).

I decided that the Personas functionality is the best way to create this
relationship.

Plan: When a user (physical) is imported, persons (contracts) should be
created for each contract_id.

Further, the contract data synchronized with other systems.
Thus a user (physical) is only needed to link together contracts related to
the same user.
After import created physical user and only one persona. User(physical)
have only one value in extension/contractId.
A user has only one extension/contractId value and only one persona is
created.

Can I achieve the desired effect with personas?
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.
Or should I use a more appropriate functionality?

Thank you in advance,
Khangai


ObjectTemplate for personas-contracts:

<item>
    <ref>name</ref>
    <mapping>
        <source>
            <path>extension/contractId</path>
        </source>
        <source>
            <path>name</path>
        </source>
        <expression>
            <script>
                <code>'contract-' + contractId + '-'+  name</code>
            </script>
        </expression>
    </mapping>
</item>

<item>
    <ref>extension/contractId</ref>
    <mapping>
        <source>
            <path>extension/contractId</path>
        </source>
    </mapping>
</item>

<item>
    <ref>extension/cardNumber</ref>
    <mapping>
        <source>
            <path>extension/cardNumber</path>
        </source>
    </mapping>
</item>


My resource mappings:

<attribute>
    <ref>icfs:uid</ref> <!--This is user_id column-->
    <outbound>
        <source>
            <path>$focus/name</path>
        </source>
    </outbound>
    <inbound>
        <target>
            <path>$focus/name</path>
        </target>
    </inbound>
    <inbound>
        <expression>
            <value>
                <targetRef oid="ca4ee9dd-6b08-48e7-a596-332bd49cb938"
type="RoleType"/>
            </value>
        </expression>
        <target>
            <path>assignment</path>
        </target>
    </inbound>
</attribute>

<attribute>
    <ref>ri:firstname</ref>
    <displayName>First name</displayName>
    <outbound>
        <source>
            <path>$focus/givenName</path>
        </source>
    </outbound>
    <inbound>
        <target>
            <path>$focus/givenName</path>
        </target>
    </inbound>
</attribute>

<attribute>
    <ref>ri:lastname</ref>
    <displayName>Last name</displayName>
    <outbound>
        <source>
            <path>$focus/familyName</path>
        </source>
    </outbound>
    <inbound>
        <target>
            <path>$focus/familyName</path>
        </target>
    </inbound>
</attribute>

<attribute>
    <ref>ri:fullname</ref>
    <outbound>
        <source>
            <path>$focus/fullName</path>
        </source>
    </outbound>
    <inbound>
        <target>
            <path>$focus/fullName</path>
        </target>
    </inbound>
</attribute>

<attribute>
    <ref>ri:contract_id</ref>
    <outbound>
        <source>
            <path>$focus/extension/contractId</path>
        </source>
    </outbound>
    <inbound>
        <target>
            <path>$focus/extension/contractId</path>
        </target>
    </inbound>
</attribute>

<attribute>
    <ref>ri:card_number</ref>
    <outbound>
        <source>
            <path>$focus/extension/cardNumber</path>
        </source>
    </outbound>
    <inbound>
        <target>
            <path>$focus/extension/cardNumber</path>
        </target>
    </inbound>
</attribute>

Correlation in synchronization:

<correlation>
    <q:equal>
        <q:path>c:name</q:path>
        <expression>
            <path>$projection/attributes/uid</path>
        </expression>
    </q:equal>
</correlation>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220808/9d837859/attachment.htm>


More information about the midPoint mailing list