hi Nidhish,
There is a simple redwood script to submit a job :
{ //Get the job definition JobDefinition jobdef=jcsSession.getJobDefinitionByName("System_Info"); //Create the Job Job infoJob=jobdef.prepare(); //Get the Queue Queue SystemQ=jcsSession.getQueueByName("System"); //Attach queue to job infoJob.setQueue(SystemQ); //Print out the jobid of the job jcsOut.println(infoJob.getJobId()); //Submit the job jcsSession.persist(); }
Now, since you a list of job, there are several ways to do this;
- Put the above script in a for loop, prepare a file (may be a txt file with job defintion in every new line), pass the file path as a parameter to the Redwood Script job, parse the file in java and feed each new line as an input to getJobDefinitionByName method in the for loop.
or - Hard code the entire list in the script, for example,
JobDefinition jobdef1=jcsSession.getJobDefinitionByName("JOB_PAYMENT");
JobDefinition jobdef2=jcsSession.getJobDefinitionByName("JOB_INVOICE");
for every job. - Now schedule the Redwood script job to run every 2 hours from Monday to Friday.
or - you can also hardcode the setTimeWindow and setSubmitFrame and run the script only once, but the jobs are submitted on a recurring manner.
Thanks
nanda