SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Help with Javascript

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Help with Javascript
Author Message
qdnguyen



Joined: 29 Sep 2009
Posts: 10
Country: United States

Post Help with Javascript Reply with quote
Hi,

I am setting up lots of Javascript jobs and all these jobs are almost the same: read some configurations from a file and use those configurations to make some shell scripts calls. The differences between these jobs are actually what shell scripts to call. So, I do a lot of copy and paste of Javascript code from one job to another. How can I avoid this type of code duplication? Is there a way that we could make a Javascript object to encapsulate all the common code and import and use those objects in the jobs?

Thanks
Tue Apr 27, 2010 4:51 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
If you want, you can place the common code into a schedule-less job, and just invoke that job from other jobs using Scheduler.runJob(…) or similar method. You can pass the necessary parameters via environment variables, or files. Using files is likely better because the changes are sticky, and can be also seen by multiple jobs and easier to debug.
Tue Apr 27, 2010 6:31 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.