<div dir="ltr"><div>I reach code working. But I am not sure that I understand the concept.<br></div>So, can someone approve that this is correct behavior for:<br>If we redefine, for example, ri:manager in role or archetype construction then sequence of calculation is the following:<div>1) MP calculates AD manager using role or archetype construction for attribute ri:manager</div><div>2) MP calculates AD manager using schemaHandling for attribute ri:manager and uses this knowledge somehow by its algorithm</div><div>So, that means we must write schemaHandling code with a thought about future roles or archetype implementation.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br class="gmail-Apple-interchange-newline"><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 2 May 2022 at 14:46, Yakov Revyakin <<a href="mailto:yrevyakin@gmail.com">yrevyakin@gmail.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"><div dir="ltr">It looks like the archetype mapping for ri:manager is fully processed yet. But after that MP runs ri.manager mapping from default mapping in schemaHandling. Could you interpret what happens? <div><br></div>INFO (com.evolveum.midpoint.expression): CN=Ali Si,OU=Contractors,OU=dev2,OU=midpoint,DC=examlabpractice,DC=corp<br>INFO (com.evolveum.midpoint.model.common.mapping.AbstractMappingImpl): Mapping trace:<br>---[ MAPPING  in outbound mapping for attribute {.../resource/instance-3}manager in archetype:685106e4-1dfe-11eb-8429-534869969212(Contractor Archetype)]---------------------------<br>Strength: STRONG<br>Source contractorManagerNumber:<br>  old: PP({<a href="http://example.com/xml/ns/midpoint/schema%7DcontractorManagerNumber):%5BPPV(String:100064" target="_blank">http://example.com/xml/ns/midpoint/schema}contractorManagerNumber):[PPV(String:100064</a>)]<br>  delta: null<br>  new: PP({<a href="http://example.com/xml/ns/midpoint/schema%7DcontractorManagerNumber):%5BPPV(String:100064" target="_blank">http://example.com/xml/ns/midpoint/schema}contractorManagerNumber):[PPV(String:100064</a>)]<br>Target: rRAD:{.../resource/instance-3}manager {xsd:}string[0,1],RAM native=manager framework=manager,Disp,OUT,IN:MODEL<br>Expression: script: ScriptExpression( import com.evolveum.midpoint.xml.ns._publ...)<br>Condition: true -> true<br>Result: unchanged: CN=Ma Gog dev2,OU=MARKETING,OU=dev2,OU=midpoint,DC=examlabpractice,DC=corp<br>------------------------------------------------------<br>###the following 2 lines indicate that ri:manager in shemaHandling was involved<br>INFO (com.evolveum.midpoint.expression): ad<br>ERROR (com.evolveum.midpoint.model.common.expression.script.ScriptExpression): Expression error: Index 0 out of bounds for length 0 in (old) expression in mapping in outbound mapping for attribute {.../resource/instance-3}manager in resource:746ecf5e-3e8c-11e6-b2f9-3c970e44b9e2(AD)<br><div> <br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 2 May 2022 at 11:33, Yakov Revyakin <<a href="mailto:yrevyakin@gmail.com" target="_blank">yrevyakin@gmail.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"><div dir="ltr"><div>Hi friends,<br></div><div><br></div>I have default mapping in AD schemaHandling for ri:dn and ri:manager with normal strength.<div>I also have alternative mapping in an archetype for the same attributes with strong strength defined as inducement with order=2 for UserType. The archetype is assigned to an org. All users under the org get AD accounts with right dn via the archetype mapping for dn. </div><div><br></div><div>So, the mapping for dn works properly via any path - default or archetype dependent on business logic.</div><div>If I comment default mapping for ri:manager in schemaHandling my mapping in archetype works fine.</div><div>If I uncomment default mapping for ri:manager in schemaHandling I have the following picture:<br></div><div>1) MP calculates new ri:manager using archetype mapping</div><div>2) calculates old value using schemaHandling mapping getting an error. Calculation even doesn't enter the archetype mapping.</div><div><br></div><div>I am waiting for the calculation to be done by the archetype mapping completely. </div><div><br></div><div>How to solve this collision?</div><div>Thanks,</div><div>  </div></div>
</blockquote></div>
</blockquote></div>