SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
24X7 Scheduler : New Job creation

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
24X7 Scheduler : New Job creation
Author Message
TJ



Joined: 21 Jun 2005
Posts: 35

Post 24X7 Scheduler : New Job creation Reply with quote

A couple of issues:
1. I am unable to find the Job template mentioned in the document.
2. While trying to create a New Job:
//New Task creation Code

String JobDefinition = "TJMyJob1";

// create new job

retCode = TJScheduler.createJob( JobDefinition );

System.out.println("Retcode is "+ retCode); // Print error

if (retCode < 0)

System.out.println(TJScheduler.getLastError()); // Print error

else

System.out.println("Job ID: " + retCode.toString());

This is the error I get:
" Error accessing database: 5 "

I basically want to compile a Java file (That is the Job)...Could you please tell me where I am going wrong?

3. I would like to back up the Job folders along with the Jobs on my server from the scheduler...how do i go about doing that?

Thanks in advance.

Wed Jun 22, 2005 5:38 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: 24X7 Scheduler : New Job creation Reply with quote

1. Not sure what you mean here. Please specify which document/page are talking about.

2. I've never seen this error before. My guess, you have specified incorrect job properties. Please post your code here.

3. Job folders are logical objects (don't confuse them with file folders in Windows) and cannot be backed up in that sense. If you want backup the entire job database which is just a single file whose default name is DefaultJobDB.dat. You can create copies of that file with different names using File/Save As command in 24x7 GUI.

: A couple of issues: 1. I am unable to find the Job template mentioned in the
: document.
: 2. While trying to create a New Job: //New Task creation Code

: String JobDefinition = "TJMyJob1";

: // create new job

: retCode = TJScheduler.createJob( JobDefinition );

: System.out.println("Retcode is "+ retCode); // Print error

: if (retCode < 0)

: System.out.println(TJScheduler.getLastError()); // Print error

: else

: System.out.println("Job ID: " + retCode.toString());

: This is the error I get: " Error accessing database: 5 "

: I basically want to compile a Java file (That is the Job)...Could you please
: tell me where I am going wrong?

: 3. I would like to back up the Job folders along with the Jobs on my server
: from the scheduler...how do i go about doing that?

: Thanks in advance.

Wed Jun 22, 2005 5:54 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: 24X7 Scheduler : New Job creation Reply with quote

The Document I was refering to is: Java API Reference:
Pg # 20:
Refers to Template.

Well even I thought I was not defining the job properties correctly...could you give me an example of defining it? The code is what I pasted in the previous response.

Thanks again!!

: 1. Not sure what you mean here. Please specify which document/page are
: talking about.

: 2. I've never seen this error before. My guess, you have specified incorrect
: job properties. Please post your code here.

: 3. Job folders are logical objects (don't confuse them with file folders in
: Windows) and cannot be backed up in that sense. If you want backup the
: entire job database which is just a single file whose default name is
: DefaultJobDB.dat. You can create copies of that file with different names
: using File/Save As command in 24x7 GUI.

Wed Jun 22, 2005 6:03 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: 24X7 Scheduler : New Job creation Reply with quote

1. This stuff is for the web-based interface and it is not applicable to the 24x7 Scheduler Java Edition anyway. If a job was created from a template using 24x7 web-based interface or your custom interface you can save template name and data (anything you want) with the job properties so that if the user later needs to edit the job you can fill the screen with the original template and data, in other words restore the original screen as it appeared at the time of the initial job submission. For more info please see "Working with templates" topic in the 24x7 Web-based Management Console User's Guide (starting on page 19).

2. Here is an example that will create a new folder and a new job within that folder. If you want to create job an existing folder specify existing folder Id instead of folderId variable.

// open session here ...

IntegerHolder holder = new IntegerHolder(new Integer(0));
remote24x7.createFolder("Some folder", "folder description here", holder);
int folderId = ((Integer)holder.getValue()).intValue();

String jobDefinition = "NAME=My New Job\r\n" +

"COMMAND=c:\\winnt\\notepad.exe\r\n" +

"SCHEDULE_TYPE=D\r\n" +

"FRIDAY=Y\r\n" +

"SUNDAY=Y\r\n" +

"MONDAY=Y\r\n" +

"TUESDAY=Y\r\n" +

"WEDNESDAY=Y\r\n" +

"THURSDAY=Y\r\n" +

"SATURDAY=Y\r\n" +

"START_TIME=10:00\r\n" +

"ASYNC=N\r\n" +

"LOG=Y\r\n" +

"DESCRIPTION=job description\r\n" +

"JOB_TYPE=P\r\n" +

"FOLDER=" + folderId + "\r\n" +

"QUEUE=[default]";
Integer jobId = remote24x7.createJob(jobDefinition);

// close session here ....

: The Document I was refering to is: Java API Reference: Pg # 20: Refers to
: Template.

: Well even I thought I was not defining the job properties correctly...could
: you give me an example of defining it? The code is what I pasted in the
: previous response.

: Thanks again!!

Wed Jun 22, 2005 6:33 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: 24X7 Scheduler : New Job creation Reply with quote

Thanks a Ton!! That was a lot of help!!!

: 1. This stuff is for the web-based interface and it is not applicable to the
: 24x7 Scheduler Java Edition anyway. If a job was created from a template
: using 24x7 web-based interface or your custom interface you can save
: template name and data (anything you want) with the job properties so that
: if the user later needs to edit the job you can fill the screen with the
: original template and data, in other words restore the original screen as
: it appeared at the time of the initial job submission. For more info
: please see "Working with templates" topic in the 24x7 Web-based
: Management Console User's Guide (starting on page 19).

: 2. Here is an example that will create a new folder and a new job within that
: folder. If you want to create job an existing folder specify existing
: folder Id instead of folderId variable.

: // open session here ...

: IntegerHolder holder = new IntegerHolder(new Integer(0));
: remote24x7.createFolder("Some folder", "folder description
: here", holder);
: int folderId = ((Integer)holder.getValue()).intValue();

: String jobDefinition = "NAME=My New Job\r\n" +

: "COMMAND=c:\\winnt\\notepad.exe\r\n" +

: "SCHEDULE_TYPE=D\r\n" +

: "FRIDAY=Y\r\n" +

: "SUNDAY=Y\r\n" +

: "MONDAY=Y\r\n" +

: "TUESDAY=Y\r\n" +

: "WEDNESDAY=Y\r\n" +

: "THURSDAY=Y\r\n" +

: "SATURDAY=Y\r\n" +

: "START_TIME=10:00\r\n" +

: "ASYNC=N\r\n" +

: "LOG=Y\r\n" +

: "DESCRIPTION=job description\r\n" +

: "JOB_TYPE=P\r\n" +

: "FOLDER=" + folderId + "\r\n" +

: "QUEUE=[default]";
: Integer jobId = remote24x7.createJob(jobDefinition);

: // close session here ....

Thu Jun 23, 2005 9:50 am 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.