<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>we are using the scripted sql connector and midpoint 3.5.1.<br></div>Following Problem occurs when a multivalue field is updated:<br></div>The old values are removed from midpoint repo and only the new value is in midpoint. <br><br></div>On the database everything is correct there are the old values and the new one seperated by ; .<br></div>I had a look at the Logfile and found following delta's:<br><br>---[ EXECUTED delta of UserType ]---------------------<br>Channel: <a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</a><br>Wave: 0<br>ObjectDelta<UserType>(UserType:80bf9380-8e7e-42ec-bf7b-5eb05c614343,MODIFY):<br>  extension/sapmandanten<br>    ADD: 123<br>    OLD: 55, 999<br>  metadata/modifyChannel<br>    REPLACE: <a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</a><br>  metadata/modifyTimestamp<br>    REPLACE: 2017-05-10T14:21:42.469+02:00<br>  metadata/modifierRef<br>    REPLACE: oid=00000000-0000-0000-0000-000000000002<br>Result: SUCCESS: null<br>--------------------------------------------------<br><br>Then the update groovy is caled and executed. After this the Database has the correct values:<br>Entering ADD_ATTRIBUTE_VALUES Script for __ACCOUNT__ and attr [sapmandanten:[123]]<br><br><br></div>After this the delta of the Shadowtype gets listed. Here is only the new value listed (123).<br> ---[ EXECUTED delta of ShadowType ]---------------------<br> Channel: <a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</a><br> Wave: 0<br> Resource: resource:11111111-2222-3333-4444-200000000000(Portal)<br> ObjectDelta<ShadowType>(ShadowType:0303a1d2-611d-46c1-9750-d8504b69c6ce,MODIFY):<br> attributes/sapmandanten<br> ADD: 123<br> metadata/modifyChannel<br> REPLACE: <a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</a><br> metadata/modifyTimestamp<br> REPLACE: 2017-05-10T14:21:42.642+02:00<br> metadata/modifierRef<br> REPLACE: oid=00000000-0000-0000-0000-000000000002<br> Result: SUCCESS: null<br> --------------------------------------------------<br><br></div>Then the search scripted is executed the log says. After this action there is again a delta of the UserType listed which shows the delete of the old values from the multivalue field:<br> ---[ EXECUTED delta of UserType ]---------------------<br> Channel: <a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</a><br> Wave: 1<br> ObjectDelta<UserType>(UserType:80bf9380-8e7e-42ec-bf7b-5eb05c614343,MODIFY):<br> extension/sapmandanten<br> DELETE: 55, 999<br> OLD: 55, 999<br> metadata/modifyChannel<br> REPLACE: <a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</a><br> metadata/modifyTimestamp<br> REPLACE: 2017-05-10T14:21:45.630+02:00<br> metadata/modifierRef<br> REPLACE: oid=00000000-0000-0000-0000-000000000002<br> Result: SUCCESS: null<br> --------------------------------------------------<br><br></div>We end up with only the new attribute 123 in midpoint. The Database has all three values (correct). After a reconcile of the user there are all values in midpoint too, but thats not like it should work.<br></div>Maybe someone can help?<br><br></div>Our update.groovy looks like:<br>...<br>case "__ACCOUNT__":<br>attributes.get("sapmandanten").each {<br>            sql.executeUpdate(<br>                            "UPDATE users SET sapmandanten=concat_ws(';',sapmandanten, ? ) WHERE uid = ?",<br>                            [<br>                                    it,<br>                                    uid<br>                            ]<br><br><div><div><div><div><div><div><div>           )<br>}<br></div><div>break<br>...<br><br></div><div>Kind regards <br></div><div>Nico Pätzelt <br></div></div></div></div></div></div></div></div>