|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
t_vijay
Joined: 18 Jan 2011 Posts: 2 Country: India |
|
calling External program- Javascript to customize email msg |
|
Hi Guys,
Our company purchased 24x7 Scheduler MUlti Platform edition recently. We need to create generic job start and job end message in a newly created Job at the notification events level. We selected Run program & Job Start /Job Finish option to write javascript. But run program not accepts any javascript program. As we cant do using JAL/VBscript as this works only for windows platform.
Is there any specific way to call javascript external program from "Run program" option. Here javascript program sends customized mail message based on job events (start/finish/error).
Or is there any way we can pass @V"event" parameter to another job to achieve the same result.??
Please let us know.. and do the needful.
Many Thanks
|
|
Tue Jan 18, 2011 1:06 am |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
Theoretically you can run JavaScripts from command line on any system using command line Java version. I haven't tried that, but the command line may look like
java -classpath "js.jar;jscheduler.jar" org.mozilla.javascript.tools.shell.Main my_javascript_code.js [args here]
Please note that the symbol separating multiple files in the classpath parameter is platform dependent
use ; on Windows systems, use : on *nix and Mac systems
As for passing values between JS jobs, there are many ways. For example, from job A you can write them to a file named jobB.data and from job B read that file. To trigger job B from A use job dependencies, job chaining, or JS calls like
var runId = Scheduler.runJob(125);
here in this example, 125 ias the id of job B
|
|
Tue Jan 18, 2011 9:11 am |
|
|
|
|
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
|
|
|