On 06/03/2019 10:31, Karim Ayari wrote:
> hello,
> 
> im trying to get a value from a multi valued attribute
> 
> when i print it from lsc i got this result :
> 
> [aaaaa, bbbbbb, ccccc, Aida_uid]
> 
> i want to get only the value which contains the Aida_uid string
> 
> but when i run lsc i got this result :
> 
> 
> /mars 06 10:22:17 - INFO  - # Updating object 
> CN=BLABLA,OU=_Utilisateurs,DC=local for LdapSync2AD//
> //# Wed Mar 06 10:22:17 CET 2019//
> //dn:: 
> Q049Qm91dmV0IEhlbGVuZSxPVT1fVXRpbGlzYXRldXJzLE9VPUFjYWTDqW1pZSxEQz1hYy1seW9uLERDPWxvY2Fs//
> //changetype: modify//
> //replace: description//
> //*description: org.mozilla.javascript.Undefined@4ee7594*/
> 
> here is the dataset :
> 
> /    <dataset>//
> //    <name>description</name>//
> //     <policy>FORCE</policy>//
> //     <forceValues>//
> //      <string><![CDATA[rjs://
> //        var desc = srcBean.getDatasetById("description");//
> //        if (desc != null && desc != "[-]") {//
> //          for (var i = 0; i < desc.size() ; i++) {//
> //            if (desc(i).contains("Aida_")) {//
> //              java.lang.System.out.println(desc(i));//
> //            }//
> //        }//
> //        }//
> //        ]]></string>//
> //     </forceValues>//
> //    </dataset>/

Hi,

You're not returning any value to set in your dst attribute.

Try this
<string>
var ret = [];
var desc = srcBean.getDatasetById("description");
for (var i = 0; i < desc.size() ; i++) {
        if (desc.get(i).indexOf("Aida_") > -1) {
                ret.push(desc.get(i));
        }
}
ret
</string>

Regards
-- 
Soisik Froger | Software Architect

[email protected]

Worteks | https://www.worteks.com
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to