<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-06-30 18:16 GMT+02:00 Pálos Gustáv <span dir="ltr"><<a href="mailto:gustav.palos@evolveum.com" target="_blank">gustav.palos@evolveum.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Bolat,<div><br></div><div>sorry for the late answer, you need to set filter in this way:</div><div><span class=""><div> <assignmentTargetSearch></div><div> <targetType>c:OrgType</targetType></div><div> <filter></div><div> <q:equal></div></span><div> <q:path><b>c:identifier</b></q:path></div><span class=""><div> <expression></div><div> <script></div><div> <code><span style="white-space:pre-wrap"> </span></div><div> </div><div><span style="white-space:pre-wrap"> </span>return costCenter</div><div><span style="white-space:pre-wrap"> </span></code></div><div> </script></div><div> </expression></div><div> </q:equal></div><div> </filter></div></span></div><div>...</div><div><br></div><div>you need to find org with c:identifier what you have in costCenter in child org as parent_id and not his c:name.</div><div><br></div><div>And sorry for my previous User-Org assignment sample, for Orgs-Orgs assignments you don't need to do this way. It's better to do this in your's way.</div><div><br></div><div>Gustav</div><div><div class="h5"><div><br><div class="gmail_extra"><br><div class="gmail_quote">2016-06-15 7:30 GMT+02:00 Болат Казыбаев <span dir="ltr"><<a href="mailto:B.kazybayev@ktg.kz" target="_blank">B.kazybayev@ktg.kz</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="RU" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Gustav,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<pre><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thank you for your example. As I said before, in previous post</span><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">: “</span><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:black">I have, “name” property as org_id, and “costCenter” property as parent_id.” I made an assignment of root org, even though I am not sure if this a correct way.</span><span lang="EN-US" style="font-family:Calibri,sans-serif;color:black"><u></u><u></u></span></pre>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><populateItem><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <expression><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <assignmentTargetSearch><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <targetType>c:OrgType</targetType><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <filter><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <q:equal><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <q:path>c:name</q:path><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <expression><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <script><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <code>
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> return costCenter<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </code><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </script><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </expression><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </q:equal><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </filter><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </assignmentTargetSearch><u></u><u></u></span></p><span>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </expression><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <target><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> <c:path>assignment</c:path><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </target><u></u><u></u></span></p>
</span><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"></populateItem><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> midPoint [mailto:<a href="mailto:midpoint-bounces@lists.evolveum.com" target="_blank">midpoint-bounces@lists.evolveum.com</a>]
<b>On Behalf Of </b>Palos Gustav<br>
<b>Sent:</b> Tuesday, June 14, 2016 5:10 PM<br>
<b>To:</b> midPoint General Discussion <<a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a>></span></p><div><div><br>
<b>Subject:</b> Re: [midPoint] Synchronizing organizational structure with DatabaseTableConnector<u></u><u></u></div></div><p></p><div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Bolat,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have an example how can I assign user to existing org in midpoint by midpoint.searchObjectByName in object template.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The similar can work for you, but you need to run import in right order (first root, next his childs, ...)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><objectTemplate xmlns="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3" target="_blank">http://prism.evolveum.com/xml/ns/public/query-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:icfc="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:icfs="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:t="<a href="http://prism.evolveum.com/xml/ns/public/types-3" target="_blank">http://prism.evolveum.com/xml/ns/public/types-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:cap="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:apti="<a href="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/common/api-types-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:ds="<a href="http://www.w3.org/2000/09/xmldsig" target="_blank">http://www.w3.org/2000/09/xmldsig#</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:enc="<a href="http://www.w3.org/2001/04/xmlenc" target="_blank">http://www.w3.org/2001/04/xmlenc#</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:ri="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" target="_blank">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:cdoext="<a href="http://xml.uniba.sk/cdoext" target="_blank">http://xml.uniba.sk/cdoext</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> oid="10000000-0000-0000-0210-000000000101"><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <name>User Template</name><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <mapping><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <name>User org mapping</name><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <authoritative>true</authoritative><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <source><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <c:path xmlns:ext="<a href="http://xxx" target="_blank">http://xxx</a>">extension/namesOfOrgs</c:path><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <c:name>namesOfOrg</c:name><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </source><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <expression><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <script><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <!-- <relativityMode>absolute</relativityMode> --><!-- FIX for multivalue --><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <code><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> import java.util.*;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <a href="http://log.info" target="_blank">log.info</a>("XXX assigning from org {}" , namesOfOrg)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> if (namesOfOrg != null){<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> org = midpoint.searchObjectByName(OrgType.class, namesOfOrg);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <a href="http://log.info" target="_blank">log.info</a>("org {}" , org)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> orgOrt = new ObjectReferenceType();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> orgOrt.setOid(org.getOid());<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> orgOrt.setType(OrgType.COMPLEX_TYPE);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> AssignmentType assignment = new AssignmentType();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> assignment.asPrismContainerValue()<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> assignment.setTargetRef(orgOrt);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> return assignment<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </code><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </script><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </expression><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <target><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <c:path>assignment</c:path><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </target><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <condition><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <script><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <code><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> return namesOfOrg != null<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </code><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </script><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </condition><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> </mapping> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"></objectTemplate><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Gustav<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2016-06-14 12:48 GMT+02:00 Болат Казыбаев <<a href="mailto:B.kazybayev@ktg.kz" target="_blank">B.kazybayev@ktg.kz</a>>:<u></u><u></u></p>
<blockquote style="border-style:none none none solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)">Hi Pavol,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)">Thank you for your suggestion. I changed “Identifier” to lower-case and it works. </span><span lang="EN-US" style="font-family:Wingdings;color:rgb(31,73,125)">J</span><span lang="EN-US" style="color:rgb(31,73,125)">
Now I need to make an organization tree using parent-child reference. In fact now I have, “name” property as org_id, and “costCenter” property as parent_id. Any suggestions how to make it?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<div>
<div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>From:</b> midPoint [mailto:<a href="mailto:midpoint-bounces@lists.evolveum.com" target="_blank">midpoint-bounces@lists.evolveum.com</a>]
<b>On Behalf Of </b>Pavol Mederly<br>
<b>Sent:</b> Tuesday, June 14, 2016 3:41 PM<br>
<b>To:</b> <a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a><br>
<b>Subject:</b> Re: [midPoint] Synchronizing organizational structure with DatabaseTableConnector<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p>Hello Bolat,<u></u><u></u></p>
<p>I would suggest replacing c:Identifier with c:identifier (lower-cased) - in all paths referencing "identifier" property of the OrgType; including the search filter used for correlation.<u></u><u></u></p>
<p>Best regards,<u></u><u></u></p>
<p>Pavol<u></u><u></u></p>
<div>
<p class="MsoNormal">On 14.06.2016 11:32, Болат Казыбаев wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal"><span lang="EN-US">Hello all,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I’m trying to sync my org data from database table to midpoint. I read all previous topics about that and compose resource xml (in attachment). There is an error:
“Failed to import: com.evolveum.midpoint.util.exception.SystemException: Error occurred during resource object shadow owner lookup, reason: Couldn't search user”.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Where am I wrong in xml configuration?</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-bottom:12pt"><br>
<br>
<u></u><u></u></p>
<pre>_______________________________________________<u></u><u></u></pre>
<pre>midPoint mailing list<u></u><u></u></pre>
<pre><a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><u></u><u></u></pre>
<pre><a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><u></u><u></u></pre>
</blockquote>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12pt"><br>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div>