I'm having trouble with onComplete Transform Scripts...

daigonite
Kilo Explorer

Hello, this is my first question here, I'm sorry if it doesn't make much sense.

Anyways, I've been trying to run an onComplete transform script that essentially queries through specific records and deactivates them. Seems simple, right? Well it's not the code that's bugging me, but rather the onComplete transform script never seems to actually run. When it's onStart I have no problems but even just having a gs.log statement seems to cause it to completely ignore my script. Does anyone have any idea what I'm doing wrong? Is there some property of transform maps that causes them to sometimes not execute the onComplete transform script?

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi Rachel,



I believe that your script may be running even when you don't see your log statements . odd ha?! try using a different logging mechanism. Perhaps the one that is used as an example out of the box for the LDAP transform scripts.



You can use the following statements to log:



log.info("Testing: Here goes some info");


log.warn("Testing: Watch out for that warning");


log.error("Testing: Houston, we have a problem!");



I believe you should be able to see the log results in the table import_log.



Do take in mind that this will require that log is defined in the onStart transform script on the following way:



gs.include("LDAPUtils"); var ldapUtils = new LDAPUtils(); ldapUtils.setLog(log);




I hope it helps!



Thanks,


Berny


View solution in original post

12 REPLIES 12

Michael Fry1
Kilo Patron

The onComplete event script is processed at the end of an import run, after all data rows are read and transformed. Did you data finishing importing?


Mike Allen
Mega Sage

So, there is an example of an onComplete script that is OOB, the LDAP User one.   In it, they run a script include:



ldapUtils.processManagers();



Maybe you can use this example, throw your script into a script include and call it in your onComplete.   It's a little round about way, but it may work.


I tried this but no dice. It appears my script isn't running at all.


Stijn Verhulst3
Kilo Guru

Hi Rachel,



if even a gs.log in the onComplete() script doesn't run; are there any other Transform Map scripts running before the onComplete() one which might fail (definitely check the system logs)?



Kind regards,



Stijn