<div dir="ltr">Thank you very much for answering so fast.<div><br></div><div>I've been trying to solve this, and got to the point of creating an Item<?,?> object to add to the extension (<a href="https://evolveum.com/downloads/midpoint/3.4/midpoint-3.4-javadoc/com/evolveum/midpoint/prism/PrismContainerValue.html#add(com.evolveum.midpoint.prism.Item">https://evolveum.com/downloads/midpoint/3.4/midpoint-3.4-javadoc/com/evolveum/midpoint/prism/PrismContainerValue.html#add(com.evolveum.midpoint.prism.Item</a>). Does anyone have an example of this? I couldn't find any. </div><div><br></div><div>Thanks in advance.</div><div>Best regards</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-19 16:54 GMT-03:00 Martin Lízner - AMI Praha a.s. <span dir="ltr"><<a href="mailto:martin.lizner@ami.cz" target="_blank">martin.lizner@ami.cz</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Although not having hands-on experience, I think you are right about <span class="m_2854045924958322838gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>setExtension(ExtensionType value), you will need to play with it a bit as you can construct new ExtensionType in simillar fashion:<div><br></div><div><div><span class="m_2854045924958322838gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>ExtensionType et = new ExtensionType(getPrismContext(<wbr>));</div><div><span class="m_2854045924958322838gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>et.asPrismContainerValue().<wbr>add(....</div></div><div><br></div><div>M.</div></div><div class="gmail_extra"><br clear="all"><div><div class="m_2854045924958322838gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><table style="font-family:Verdana,Arial,Helvetica,sans-serif;border-collapse:collapse;padding:0px;margin:0px;border-width:0px!important;border-style:solid!important;width:482px!important"><tbody><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="2" style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;vertical-align:bottom;padding:0px;border:0px solid gray!important"><p><span style="font-size:14px;font-weight:bold">Martin Lízner</span><br>solution architect<br><br>gsm: [+420] 737 745 571<br>e-mail: <a href="mailto:martin.lizner@ami.cz" target="_blank">martin.lizner@ami.cz</a></p></td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);padding:0px;border-top-width:0px!important;border-bottom-width:0px!important;border-left-width:0px!important;border-top-style:solid!important;border-bottom-style:solid!important;border-left-style:solid!important;border-top-color:gray!important;border-bottom-color:gray!important;border-left-color:gray!important"> </td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px solid gray!important"> </td><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;vertical-align:bottom;padding:0px;border:0px solid gray!important"><p>AMI Praha a.s.<br>Pláničkova 11<br>162 00 Praha 6<br>tel.: [+420] 274 783 239<br>web: <a href="http://www.ami.cz/" target="_blank">www.ami.cz</a></p></td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right-width:1px;border-right-style:solid;border-right-color:rgb(204,204,204);padding:0px;border-top-width:0px!important;border-bottom-width:0px!important;border-left-width:0px!important;border-top-style:solid!important;border-bottom-style:solid!important;border-left-style:solid!important;border-top-color:gray!important;border-bottom-color:gray!important;border-left-color:gray!important"> </td><td style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px solid gray!important"> </td><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;margin:8px;border:0px solid gray!important"><p><img src="http://www.ami.cz/images/podpis/ami_logo.gif" alt="" style="border:0px"></p></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="8" style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px solid gray!important"></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="8" style="color:rgb(128,128,128);font-family:Arial,sans-serif;font-size:11px;padding:0px;border:0px solid gray!important"><table style="font-family:Verdana,Arial,Helvetica,sans-serif;border-collapse:collapse;padding:0px;margin:0px;border-width:0px!important;border-style:solid!important;width:482px!important"><tbody><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="7" style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;width:480px;border:0px solid gray!important"><br><a href="http://www.skyidentity.com/" target="_blank"><img src="http://www.ami.cz/images/podpis/AMI-podpis-Sky.png" alt="AMI Praha a.s." style="border:0px;width:480px!important;height:82px!important"></a></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td colspan="7" style="font-family:Arial,sans-serif;padding:0px;border:0px solid gray!important"><br></td></tr></tbody></table>Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<br>jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.</td></tr></tbody></table></div><br></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">2017-01-19 20:20 GMT+01:00 Ana Pereyra <span dir="ltr"><<a href="mailto:apereyra@identicum.com" target="_blank">apereyra@identicum.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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</authorita<wbr>tive><br><span style="white-space:pre-wrap"> </span><strength>strong</strength><br> <source><br> <c:path>$focus/organization</c<wbr>:path><br> </source><br> <expression><br> <script><br> <code><br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> import com.evolveum.midpoint.xml.ns._<wbr>public.common.common_3.Assignm<wbr>entType;<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> import com.evolveum.midpoint.xml.ns._<wbr>public.common.common_3.ObjectR<wbr>eferenceType;<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> import com.evolveum.midpoint.xml.ns._<wbr>public.common.common_3.OrgType<wbr>;<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> import java.util.*;<span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> <br> org = midpoint.searchObjectByName(Or<wbr>gType.class, organization);<br> <a href="http://log.info" target="_blank">log.info</a>("org {}" , org);<br> orgOrt = new ObjectReferenceType();<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> orgOrt.setOid(org.getOid());<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> orgOrt.setType(OrgType.COMPLE<wbr>X_TYPE);<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><!-- creating assignment --><br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> AssignmentType assignment = new AssignmentType();<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> assignment.asPrismContainerVa<wbr>lue();<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> assignment.setTargetRef(orgOr<wbr>t);<br> <i><b><!-- right here we would need to that something like "setValue" for the extended attribute --><br></b></i><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> <br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> return assignment<br><span class="m_2854045924958322838m_-1000422955121299980gmail-Apple-tab-span" style="white-space:pre-wrap"> </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><span class="m_2854045924958322838HOEnZb"><font color="#888888"><div><div>-- <br><div class="m_2854045924958322838m_-1000422955121299980gmail_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></font></span></div>
<br></div></div>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.evolveum.com/mail<wbr>man/listinfo/midpoint</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>