Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8620

Re: Submit Multiple Job Definitions/Job Chains with same Time window/Submit frame in mass

$
0
0

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;

  1. 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
  2. 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.
  3. Now schedule the Redwood script job to run every 2 hours from Monday to Friday.
    or
  4. 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


Viewing all articles
Browse latest Browse all 8620

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>