cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPS & Redwood : How to change a lot of job scheduling?

Former Member
0 Kudos

Dear,

Where can I change the scheduling of a lot of jobs in SAP CPS / Redwood 8.0 (Basic license)?

Many jobs should be running in addition on Saturday. I don't find a "mass change report" to change the informationen.

Best regards,

Hans

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Nanda/HP,

I dont understand why it ended up with error whenever i run jobs not from system application.

The script is only successful if the jobs inside the file are from system application only.

Do you why? Thanks!

Alyssa

Former Member
0 Kudos

I solved this one. You just need to add RedwoodScript type of job under JobDefinitonType on the process server you want to run the job.

Former Member
0 Kudos

Hi,

How can i set the submit frame and start time of the job in scripting?

Thanks!

Former Member
0 Kudos

Below is the code for submitting job with Submit Frame.

SubmitFrame SubFrame = jcsSession.getSubmitFrameByName("Every_5_minutes");

infoJob.setSubmitFrame(SubFrame);

Former Member
0 Kudos

Hi,

Thank you for your answer. It is a good function, when you have a great group of jobs, but it could be difficult, when you only want to change some members of this group.

Frequently we have to change printer in jobs, so we have to use java script, haven't we?

Best regards,

Hans

nanda_kumar21
Active Contributor
0 Kudos

Honestly, you're missing out on a lot of features, including scripting. You should get the full version.

thanks

Nanda

h_carpenter
Active Contributor
0 Kudos

Hi Hans,

SAP CPS in the free of charge version tries to replicate standard CCMS functionality, from what I understand, and adds the bonus CPS-stuff like time windows and submit frames which, when properly used, are very powerful.

If you want to use advanced features, you have to purchase an enterprise license, we see this everywhere, in databases as well (Oracle XE vs Oracle Enterprise Edition). Sometimes you can for one specific thing work around the license, but when you really look at what features you get with the enterprise license and the time it takes to develop workarounds for features not available in the free of charge version you think about it again ... and no, I am not a sales guy 😉

Now, for your printer changes, you mean you want to change the Printer parameter on all scheduled jobs ? Yes, you would need scripting for that if you do not want to go through each scheduled job.

You could alleviate this problem somewhat by creating a job chain with job chain level parameters for the printers. That way, mapping the Printer parameter of job chain child jobs to the job chain Printer parameter(s) you only have to change it in one place to change all printers in the job chain.

Regards,

HP aka Hans-Peter 😉

Former Member
0 Kudos

Hello Nanda,


Thank you for your information. But the basic license of SAP/Redwood doesn't include the "script module".

So, I need another way,

Best regards,

Hans

nanda_kumar21
Active Contributor
0 Kudos

Hey Hans,

Then i guess, you are out of luck. There are no default job definition to perform this kind of mass activity, so the only way is scripting.

the alternate i can think of is tinkering at the Database level, but i don't recommend it.

thanks

Nanda

h_carpenter
Active Contributor
0 Kudos

Hi Hans,

In CPS, you use a submit frame to configure how often a job runs and time windows to configure when they run.

One submit frame can be used with many jobs, changing the submit frame affects all jobs that use it, the same applies to time windows.

Lets say you have a job that runs every Monday and Wednesday, the submit frame could be 1 job "daily" and the time window would be open Monday and Wednesday. Lets say you want this job to run Saturday, you simply add Saturday to the time window.

The submit request of a submit frame is issued once the job has completed, the job will then remain scheduled until the time window opens.

Lets say the time window is open on Mondays, Wednesdays, and Saturdays at 15:00 and closes at 15:05. You schedule the job today for 15:00 with the submit frame daily and the time window, the job will remain scheduled today until 15:00 at which time it will run. Once the job is completed, the submit frame will submit a new job for tomorrow (the "daily" behavior) that will wait until next Saturday to start (when the time window opens again) and so on.

You could add Friday 15:00 to the time window, for example, and the job will start on Friday at 15:00 and schedule a new job for Saturday.

Regards,

HP

nanda_kumar21
Active Contributor
0 Kudos

Lets say you have 100 jobs to run in addition on Saturday.

Create a redwood script to submit the jobs, if you want you can pass the job definitions as a parameter.

You can modify the following example form the admin guide to suit your needs.


{

// code to submit a job running System_Info

// get the job definition

JobDefinition aJobDef = jcsSession.getJobDefinitionByName("System_Info");

// create the job from the job definition

Job aJob = aJobDef.prepare();

// submit the job definition and write unsaved data to the database

jcsSession.persist();

}

You can provide your job definition in place of System_info.

Then submit the Redwood script job at the time you want.

Thanks

Nanda

Former Member
0 Kudos

Is there a way to set specific start time of the job in script?

For example:

Job1 will start @ 2:00PM

Job2 will start @ 3:00PM

Job3 will start @ 4:00PM

nanda_kumar21
Active Contributor
0 Kudos

you to use setRequestedStartTime(DateTimeZone dtz) method on the job object, to set the start time of a job.

You can create datetimeZone object like below excerpt from admin guide:

{

DateTimeZone dtz = new DateTimeZone(2011,10,31,12,10,10,10);

jcsOut.println(dtz.toString());

//if you want to include timezone

java.util.TimeZone tz = java.util.TimeZone.getTimeZone("PST");

DateTimeZone dtz = new DateTimeZone(2011,10,31,12,10,10,10);

jcsOut.println(dtz.toString());

}

Keep in mind that the month value is int monthZeroBased,  meaning that if you want to set November, then specify 10 for the month value. For January, it will be 0, and February 1, so on.

Thanks

Nanda

Former Member
0 Kudos

For example i have a file.

<jobname>,<starttime>,<queue>

System_info,2014/10/28 15:00:06,036 UTC, System

How can I set it?

Thanks!

Alyssa

nanda_kumar21
Active Contributor
0 Kudos

Split the start as 2014, 09, 28, 15, 00, 06, 036, UTC.

Now obtain the line from file and use split(",") to get them as integers.

then use the above method.

Thanks

Nanda

Former Member
0 Kudos

Got that. I just dont get how to use the timezone.

2014/10/28 15:00:06,036 UTC

I get how to parse the date: 2014/10/28 15:00:06,036  to 2014,10,28,15,00,06,036.

But how about the Timezone?How to set it for example in UTC?because the default is in GMT.

Thanks a lot!

Alyssa

Former Member
0 Kudos

Ok i got it.

dtz.setTimeZone(tz);

Thank you!