<div dir="ltr"><div dir="ltr">Hello Frederic,</div><div dir="ltr"><br></div><div dir="ltr">if you have an option to share the lookupTables e.g. as dbtables from your source, you can enrich your resource with inbounds and synchronize the data directly into midpoint lookupTable objects, instead of calling the REST API.</div><div><br></div><div>I am using this mapping to synchronize organization structure and populating some values into my own lookupTable. If you add some logic for update and delete, the lookup table should be self manageable</div><div dir="ltr"><br></div><div>Here is my piece of inbound mapping:</div><div>--snip--<br></div><div><inbound><br>      <strength>strong</strength><br>       <expression><br>            <script><br>                        <code><br>                import com.evolveum.midpoint.xml.ns._public.common.common_3.*<br>                import com.evolveum.prism.xml.ns._public.types_3.PolyStringType<br>                import com.evolveum.midpoint.schema.GetOperationOptions;<br>                import com.evolveum.midpoint.schema.RelationalValueSearchQuery;<br>                import com.evolveum.midpoint.schema.RelationalValueSearchType;<br>                import com.evolveum.midpoint.schema.SelectorOptions;<br><br>                import com.evolveum.midpoint.prism.delta.builder.*<br>                import com.evolveum.midpoint.prism.delta.ObjectDelta;<br><br>                import static com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType.F_ROW;<br>                import static com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType.F_NAME;<br><br>                prism = midpoint.getPrismContext()<br>                LookupTableRowType rw = new LookupTableRowType(prism)<br>                //my custom lookupTable OID<br>                              lOid = 'lookupz0-feed-0000-0000-000000000240';<br><br>                //generate friendly name<br>                            oName = basic.getAttributeValue(shadow, "NAME") + ' ('+ input + ')';<br>                myLabel = PolyStringType.fromOrig(basic.stringify(oName))<br>                             <br>                              //set-up lookupTable value<br>                            oIdentifier = basic.getAttributeValue(shadow, "IDENTIFIER")<br>                <br>                rw.setKey(basic.stringify(oIdentifier));<br>                rw.setLabel(myLabel);<br><br>                modifications = prismContext.deltaFor(LookupTableType.class).item(F_ROW).add(rw).asObjectDeltas(lOid);<br>                midpoint.executeChanges(modifications, null); <br>                    </code><br>         </script><br>       </expression><br>   <target><br>                <c:path>description</c:path><br>      </target><br></inbound><br></div><div><br></div><div>--snip--</div><div>Hope this helps.<br></div><div><br></div><div>Peter.</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Sent from Sony Xperia™ smartphone.</span><br></div><div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="font-size:small">Please excuse any typos.</div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 13, 2021 at 12:00 PM <<a href="mailto:midpoint-request@lists.evolveum.com">midpoint-request@lists.evolveum.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send midPoint mailing list submissions to<br>
        <a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:midpoint-request@lists.evolveum.com" target="_blank">midpoint-request@lists.evolveum.com</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:midpoint-owner@lists.evolveum.com" target="_blank">midpoint-owner@lists.evolveum.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of midPoint digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: Lookuptable synchronization (Slavek Licehammer)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 12 Apr 2021 23:58:17 +0200<br>
From: Slavek Licehammer <<a href="mailto:slavek.licehammer@evolveum.com" target="_blank">slavek.licehammer@evolveum.com</a>><br>
To: midPoint General Discussion <<a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a>><br>
Subject: Re: [midPoint] Lookuptable synchronization<br>
Message-ID: <<a href="mailto:16339986-a2ab-99b5-c639-ab64995a4330@evolveum.com" target="_blank">16339986-a2ab-99b5-c639-ab64995a4330@evolveum.com</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
Hello Frederic.<br>
<br>
MidPoint is not able to synchronize lookup tables by itself, but you can update them using REST API call. <br>
<br>
That means you need to generate the lookup table as XML, JSON or YAML file and then upload it using REST call like this one:<br>
<br>
curl --user administrator:5ecr3t -H "Content-Type: application/xml" -X PUT <a href="http://localhost:8080/midpoint/ws/rest/lookupTables/d74d9990-3953-11e6-ab88-7fda62960e0f" rel="noreferrer" target="_blank">http://localhost:8080/midpoint/ws/rest/lookupTables/d74d9990-3953-11e6-ab88-7fda62960e0f</a> -d @lookuptable.xml<br>
<br>
Detailed REST API documentation is here: <a href="https://wiki.evolveum.com/display/midPoint/REST+API" rel="noreferrer" target="_blank">https://wiki.evolveum.com/display/midPoint/REST+API</a><br>
<br>
The update can be done in runtime. There is no need for restart or anything else.<br>
<br>
Best regards, <br>
<br>
   Slavek<br>
<br>
<br>
On 17/03/2021 17:05, Frédéric Lohier via midPoint wrote:<br>
> Hello,<br>
> <br>
> <br>
> We are using several lookup tables as enumeration in the user template as described here <a href="https://wiki.evolveum.com/display/midPoint/Lookup+Tables" rel="noreferrer" target="_blank">https://wiki.evolveum.com/display/midPoint/Lookup+Tables</a> <<a href="https://wiki.evolveum.com/display/midPoint/Lookup+Tables" rel="noreferrer" target="_blank">https://wiki.evolveum.com/display/midPoint/Lookup+Tables</a>>.<br>
> <br>
> The content of some of our lookup tables is managed by another entity. For example, the standardized list of employee titles is managed by Human Resources.<br>
> <br>
> Is it possible to synchronize lookup tables with data coming from a third-party system? Is it the best approach for this use case? Do you have any example that I can use?<br>
> <br>
> -Frederic<br>
> <br>
> _______________________________________________<br>
> midPoint mailing list<br>
> <a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
> <a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
> <br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
<br>
<br>
------------------------------<br>
<br>
End of midPoint Digest, Vol 108, Issue 12<br>
*****************************************<br>
</blockquote></div></div>