<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:16.0pt">Pavol:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt">Conceptually, I know “why” it throws the exception but I wonder if it can be considered as a “bug” or “improvement” for the midpoint.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt">I have a particular use case, where I have a resource that I only need to do outbound mapping. The resource, however, does not provide an API for me to do something like getAll() operations. In other words,
 I cannot do an initial import kind of task to force midpoint to create all the shadow account.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt">Thus, when a property change that triggers an outbound mapping, midpoint noted that the resource does not exist, so it calls the create() method on the connector. Unlike the executeQuery method, which can
 construct a connectorObject and ask midpoint to handle it. The create method can only return a “Uid”. I understand the rational under this as the connector.create() is meant to create a remote resource as opposed to create the shadow account, (I guess is mirrored
 by the connectorObject). Upon receiving the UID, the midpoint then creates a matching shadow account with it (due to the absence of it). However, as both __UID__ and __NAME__ are *<b>required</b>* attributes for a connectorObject (i.e., shadow account), then
 a later verification step failed the check and throws the exception.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt">The exception appears non-preemptive, i.e., it does create the shadow account, which name, I can later fill when the updateDelta is called. The exception trace would be more of a nuance than error. Yet, I
 think it would be nice that midpoint can do some auto remedy for it. For example, during the validation phase, copy the __uid__ to __name__ if the latter is absent etc.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt">Or, if there might be some other way to get around this particular use case of mine, I would be glad to hear it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt">Xiaoshu<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">midPoint <midpoint-bounces@lists.evolveum.com> on behalf of Pavol Mederly via midPoint <midpoint@lists.evolveum.com><br>
<b>Date: </b>Wednesday, July 6, 2022 at 5:10 AM<br>
<b>To: </b>midpoint@lists.evolveum.com <midpoint@lists.evolveum.com><br>
<b>Cc: </b>Pavol Mederly <mederly@evolveum.com><br>
<b>Subject: </b>Re: [midPoint] Couldn't determine shadow name<o:p></o:p></span></p>
</div>
<p>Hi Xiaoshu,<o:p></o:p></p>
<p>I always recommend to have a look at the code that throws the exception. In your case it's most probably this one:<o:p></o:p></p>
<p><a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvolveum%2Fmidpoint%2Fblob%2Fd317537626a99db32764c486507f1c1ac5a47fb6%2Finfra%2Fschema%2Fsrc%2Fmain%2Fjava%2Fcom%2Fevolveum%2Fmidpoint%2Fschema%2Futil%2FShadowUtil.java%23L688-L736&data=05%7C01%7C%7C6db71273b9e54c31b99b08da5f2f5dc8%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637926954285726547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hAMdFcxeO%2FQlRRUqGHNHQCoLi4sWNZzxRQummPvlDtE%3D&reserved=0">https://github.com/Evolveum/midpoint/blob/d317537626a99db32764c486507f1c1ac5a47fb6/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ShadowUtil.java#L688-L736</a><o:p></o:p></p>
<p>(lines are shifted probably because of midPoint version mismatch)<o:p></o:p></p>
<p>It should give you a clue - e.g. does your object have a primary identifier set? Etc...<o:p></o:p></p>
<p>Regards,<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Pavol Mederly<o:p></o:p></pre>
<pre>Software developer<o:p></o:p></pre>
<pre>evolveum.com<o:p></o:p></pre>
<div>
<p class="MsoNormal">On 23/06/2022 15:27, Wang, Xiaoshu via midPoint wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:16.0pt">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">I am developing a custom connector. When I assign the resource connected with that connector, I got the following exception.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">com.evolveum.midpoint.util.exception.SchemaException: Could not determine shadow name.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">          at com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowStringName(ShadowUtil.java:695)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">          at com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowName(ShadowUtil.java:667)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">          ….</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">The exception seems not do anything “harmful” as far as I can tell because the new account would be listed under the resource. But I want to know why. Hope someone can shed some light on for me.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:16.0pt">Xiaoshu</span><o:p></o:p></p>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>midPoint mailing list<o:p></o:p></pre>
<pre><a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><o:p></o:p></pre>
<pre><a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.evolveum.com%2Fmailman%2Flistinfo%2Fmidpoint&data=05%7C01%7C%7C6db71273b9e54c31b99b08da5f2f5dc8%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637926954285726547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=c%2FCeTzy7i7FA5tBl2pWQBA4Wnb1j%2FdOkMCDAltEdPAQ%3D&reserved=0">https://lists.evolveum.com/mailman/listinfo/midpoint</a><o:p></o:p></pre>
</blockquote>
</div>
</body>
</html>