On 01/02/2018 12:32, Vincent LEPETIT wrote:
Hi,

I had write a javascript to make a process in one of my dataset.

I had followed this page to declare my script in lsc.xml :
https://lsc-project.org/documentation/latest/scripting/start

my function name : return_maxleavingdate
This function work on « description »  source ldap attribute

And i call my function like this :

<dataset>
      <name>accountExpires</name>
            <policy>FORCE</policy>
                  <forceValues>
                      
<string>js:AD.getAccountExpires(return_maxleavingdate(srcBean.getDatasetFirstValueById("description")),"yyyyMMdd")</string>
                   </forceValues>
  </dataset>

or like this :

<dataset>
      <name>accountExpires</name>
            <policy>FORCE</policy>
                  <forceValues>
                      
<string><![CDATA[js:AD.getAccountExpires(return_maxleavingdate(srcBean.getDatasetFirstValueById("description")),"yyyyMMdd")]]></string>
                   </forceValues>
  </dataset>

but when i call my function  i had this error messages :

févr. 01 12:24:43 - ERROR - Fail to compute expression: 
AD.getAccountExpires(return_maxleavingdate(srcBean.getDatasetFirstValueById("description")),"yyyyMMdd")
 on id=uid=utest002,ou=people,dc=univ-psl,dc=fr
Reason: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: 
"return_maxleavingdate" n'est pas défini (<Unknown source>#5) in <Unknown 
source> at line number 5
févr. 01 12:24:43 - ERROR - Error while synchronizing ID {uid=utest002}: 
org.lsc.exception.LscServiceException: javax.script.ScriptException: 
sun.org.mozilla.javascript.EcmaError: ReferenceError: "return_maxleavingdate" n'est pas 
défini (<Unknown source>#5) in <Unknown source> at line number 5

Could you tell me what is wrong ?


Your function is not found by LSC.

Did you declare it, place it at the right location, and make sure it has no 
syntax error?
Could you send us the code?

--
Soisik
_______________________________________________________________
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