0

I have a groovy script which calls another groovy script. Now I want to return something from the called script.

My code is :

 public void readFromCSV(){

 //ChangeUserPassword pe = new ChangeUserPassword();
 //pe.changePassword(host,user,oldPwd,newPwd);
 String []args = [host,user,oldPwd,newPwd];
  Object ret = run(new File("ChangeUserPassword.groovy"),args);
  Global.log.info("----> "+ret);
 }

I want to return some value from ChangeUserPassword.groovy script to main script. The "ret" object holds null after the run returns. So, how can I return some value from called script to main script. Is it possible to do so?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Muhammad Salman Farooq
  • 1,325
  • 9
  • 26
  • 54
  • http://stackoverflow.com/questions/9004303/load-script-from-groovy-script or http://stackoverflow.com/questions/9136328/including-a-groovy-script-in-another-groovy – Jayan Jan 22 '14 at 07:12
  • Or http://stackoverflow.com/questions/5267481/how-to-return-value-from-groovy-to-java – tim_yates Jan 22 '14 at 09:10

0 Answers0