<div dir="ltr">Hi all.<div><br></div><div>We have the following situation: we have extended the schema of the AssignmentType object and added one attribute.</div><div><br></div><div>Simultaneously, in the user template, we have logic that assigns an org to the user based on his "organization" attribute. The tricky part is that we need to assign the org to the user, and <b>also </b>set the extended attribute of the assignment with a certain value.</div><div><br></div><div>This is the script we have so far for that mapping in the user template:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><mapping><br>      <authoritative>true</authoritative><br><span style="white-space:pre">      </span><strength>strong</strength><br>      <source><br>        <c:path>$focus/organization</c:path><br>      </source><br>      <expression><br>         <script><br>            <code><br><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>   import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;<br><span class="gmail-Apple-tab-span" style="white-space:pre">             </span>   import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;<br><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>   import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;<br><span class="gmail-Apple-tab-span" style="white-space:pre">            </span>   import java.util.*;<span class="gmail-Apple-tab-span" style="white-space:pre">               </span>   <br>                org = midpoint.searchObjectByName(OrgType.class, organization);<br>                <a href="http://log.info">log.info</a>("org {}" , org);<br>                orgOrt = new ObjectReferenceType();<br><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>    orgOrt.setOid(org.getOid());<br><span class="gmail-Apple-tab-span" style="white-space:pre">                  </span>    orgOrt.setType(OrgType.COMPLEX_TYPE);<br><span class="gmail-Apple-tab-span" style="white-space:pre">                         </span><!-- creating assignment --><br><span class="gmail-Apple-tab-span" style="white-space:pre">                  </span>    AssignmentType assignment = new AssignmentType();<br><span class="gmail-Apple-tab-span" style="white-space:pre">                     </span>    assignment.asPrismContainerValue();<br><span class="gmail-Apple-tab-span" style="white-space:pre">                   </span>    assignment.setTargetRef(orgOrt);<br>                            <i><b><!-- right here we would need to that something like "setValue" for the extended attribute --><br></b></i><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>    <br><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>    return assignment<br><span class="gmail-Apple-tab-span" style="white-space:pre">             </span>   </code><br>         </script><br>      </expression><br>      <target><br>         <c:path>assignment</c:path><br>      </target><br>   </mapping></blockquote></div><div><br></div><div>I read in the definition of the AssignmentType class, that there's a method "setExtension" that we could use, but had no luck understanding how to create and ExtensionType object with that value set.</div><div><br></div><div>Any help is appreciated. Thanks in advance.</div><div>Regards,</div><div><div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b style="font-size:12.8px">Ana Pereyra</b><br></div><div dir="ltr"><font face="verdana, sans-serif" style="font-size:12.8px"><img src="http://www.identicum.com/img/favicon.ico"> Identicum S.A.<br><i><font color="#666666">Jorge Newbery 3226, Argentina<br>Tel: +54 (11) </font></i></font><font color="#666666" face="verdana, sans-serif" style="font-size:12.8px"><i>4552.3050</i></font><div style="font-size:12.8px"><font face="verdana, sans-serif"><i><font size="1"><a href="mailto:apereyra@identicum.com" style="color:rgb(17,85,204)" target="_blank">apereyra@identicum.com</a></font></i><br><a href="http://www.identicum.com/" style="color:rgb(17,85,204)" target="_blank"><font color="#000000">www.identicum.com</font></a></font></div></div></div></div></div></div></div></div></div></div></div>
</div></div></div>