<div dir="ltr">Hello Wojciech,<div><br></div><div>Have you tried something like this?</div><div><br></div><div><i>attributes?.get("<span style="font-size:12.8px">n_family</span>")?.get(0);</i><br></div><div><i><br></i></div><div>Regards,</div></div><div class="gmail_extra"><br clear="all"><div><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"><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><font face="arial, helvetica, sans-serif"><b>Rodrigo Yanis.</b><br><img src="http://www.identicum.com/img/favicon.ico">Identicum S.A.<br></font>Jorge Newbery 3226<br>Tel: +54 (11) 4552-3050<font face="arial, helvetica, sans-serif"><br><a href="mailto:ryanis@identicum.com" target="_blank"><font color="#0b5394">ryanis@identicum.com</font></a><br><a href="http://www.identicum.com/" target="_blank"><font color="#0b5394">www.identicum.com</font></a></font></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-07-06 12:23 GMT-03:00 Wojciech Staszewski <span dir="ltr"><<a href="mailto:wojciech.staszewski@diagnostyka.pl" target="_blank">wojciech.staszewski@diagnostyka.pl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
I have a resource with ScriptedSQL 1.1.2.0-em3 connector.<br>
<br>
It worked ok, but from a certain date it gives me an error during attibutes update:<br>
<br>
switch ( action ) {<br>
<br>
    case "UPDATE":<br>
    switch ( objectClass ) {<br>
        case "__ACCOUNT__":<br>
        for (attr in accountAttrNames) {<br>
            if (attributes.get(attr) != null) {<br>
                switch (attr) {<br>
                    case "n_family":<br>
                        def family = attributes.get(attr)?.get(0).<wbr>toString();<br>
                        sql.executeUpdate("UPDATE egw_addressbook SET n_family=? WHERE account_id=?",[family,uid]);<br>
                        break;<br>
                        [...]<br>
<br>
<br>
<br>
<br>
Outbound mapping:<br>
<br>
<attribute><br>
<c:ref>ri:n_family</c:ref><br>
<outbound><br>
               <authoritative>true</<wbr>authoritative><br>
               <exclusive>false</exclusive><br>
               <strength>normal</strength><br>
               <source><br>
                  <c:path>familyName</c:path><br>
               </source><br>
</outbound><br>
</attribute><br>
<br>
<br>
<br>
The ERROR:<br>
ERROR (com.evolveum.midpoint.<wbr>provisioning.ucf.impl.connid.<wbr>ConnIdUtil): ConnId Exception java.lang.<wbr>IndexOutOfBoundsException in connector:97d430f1-d2b0-4487-<wbr>b60b-4905dc76d2ca(ICF org.forgerock.openicf.<wbr>connectors.scriptedsql.<wbr>ScriptedSQLConnector v1.1.2.0.em3): ConnectorSpec(resource:<wbr>d7a1b38c-07db-42cc-b173-<wbr>664b6e317871(EGroupWare), name=null, oid=97d430f1-d2b0-4487-b60b-<wbr>4905dc76d2ca) while updating object identified by ConnId UID '1020': Index: 0, Size: 0<br>
ERROR (com.evolveum.midpoint.<wbr>provisioning.impl.<wbr>ProvisioningServiceImpl): Couldn't modify object: unexpected problem: java.lang.<wbr>IndexOutOfBoundsException: Index: 0, Size: 0<br>
ERROR (com.evolveum.midpoint.model.<wbr>impl.lens.ChangeExecutor): Error executing changes for (account (default) on resource:d7a1b38c-07db-42cc-<wbr>b173-664b6e317871(EGroupWare))<wbr>: Internal error: java.lang.<wbr>IndexOutOfBoundsException: Index: 0, Size: 0<br>
<br>
The value of "n_family" is NULL, although "familyName" of midPoint's user is not null.<br>
<br>
I tried this (sorry, I'm not a developer):<br>
<br>
def family = attributes.get(attr)?.get(0).<wbr>toString();<br>
def family = attributes?.get(attr)?.get(0).<wbr>toString();<br>
def family = attributes.get(attr)?.get(0);<br>
def family = attributes?.get(attr)?.get(0);<br>
def family = attributes.get(attr)?.find { true };<br>
<br>
as in the example: <a href="https://github.com/Evolveum/midpoint/blob/master/samples/resources/scriptedsql/CreateScript.groovy" rel="noreferrer" target="_blank">https://github.com/Evolveum/<wbr>midpoint/blob/master/samples/<wbr>resources/scriptedsql/<wbr>CreateScript.groovy</a><br>
<br>
all with the same result, that means NULL. What is the correct working syntax?<br>
<br>
Thanks a lot,<br>
Regards,<br>
Wojciech Staszewski.<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>
</blockquote></div><br></div>