 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Notification Events and Actions in COM |
|
When you create a job in the 24x7 GUI using the Job Properties Wizard you can select Notification Events and Actions. (It's step 6 of the Wizard.) Where you can, for example, select another job to run as soon as this job has finished. I want to be able to do this through the COM interface - i.e. progmatically create a job definition, and be able to set which job to run after it. As far as I can see there isn't a way to do this using any function call, but is it possible to do it using a JAL script? I know that there is a function called RunNow that enables you to run other jobs, is it possible to use this to run a job only if the first one finishes successfully? or will it run regardless of the status of the first job? Thanks in advance for any help.
|
|
Thu Jan 22, 2004 12:43 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
In the COM interface you can call SetJobProperty method as below com24x7.SetJobProperty("10", "MSG_JOB_ID", "25") com24x7.SetJobProperty("10", "MSG_JOB", "Y") In the JKAL script you can do the following JobModify("10", "MSG_JOB_ID", "25") JobModify("10", "MSG_JOB", "Y") Here are descriptions of MSG_JOB and MSG_JOB_ID from the on-line help MSG_JOB Execute Notification Action of Run Job Type, one of the following: Y, N (yes, no) MSG_JOB_ID Job name or job id for Notification Action of Run Job Type : When you create a job in the 24x7 GUI using the Job Properties Wizard you can : select Notification Events and Actions. (It's step 6 of the Wizard.) Where : you can, for example, select another job to run as soon as this job has : finished. I want to be able to do this through the COM interface - i.e. : progmatically create a job definition, and be able to set which job to run : after it. As far as I can see there isn't a way to do this using any : function call, but is it possible to do it using a JAL script? I know that : there is a function called RunNow that enables you to run other jobs, is : it possible to use this to run a job only if the first one finishes : successfully? or will it run regardless of the status of the first job? : Thanks in advance for any help.
|
|
Thu Jan 22, 2004 9:43 am |
|
 |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Re: Notification Events and Actions in COM |
|
I have now written the code to set these, and when I look at the job properties in the job wizard in the 24x7 GUI it all looks correct. However, when I look at the Properties tab, it does not have the Notification Event Finish set to Yes. And therefore it doesn't run the 2nd job when the 1st is complete. If I then go through the Wizard to the Notification Events and uncheck Job Finish/Run another job, then recheck it, it works fine. Am I doing something wrong, or is there a problem here? : In the COM interface you can call SetJobProperty method as below : com24x7.SetJobProperty("10", "MSG_JOB_ID", : "25") : com24x7.SetJobProperty("10", "MSG_JOB", "Y") : In the JKAL script you can do the following : JobModify("10", "MSG_JOB_ID", "25") : JobModify("10", "MSG_JOB", "Y") : Here are descriptions of MSG_JOB and MSG_JOB_ID from the on-line help : MSG_JOB Execute Notification Action of Run Job Type, one of the following: Y, : N (yes, no) : MSG_JOB_ID Job name or job id for Notification Action of Run Job Type
|
|
Thu Jan 22, 2004 8:32 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
I don't think the GUI always refreshes automatically when properties are updated from a script. If you close and restart the scheduler does the Properties tab show the Notification Event Finish set to Yes for this job? : I have now written the code to set these, and when I look at the job : properties in the job wizard in the 24x7 GUI it all looks correct. : However, when I look at the Properties tab, it does not have the : Notification Event Finish set to Yes. And therefore it doesn't run the 2nd : job when the 1st is complete. If I then go through the Wizard to the : Notification Events and uncheck Job Finish/Run another job, then recheck : it, it works fine. Am I doing something wrong, or is there a problem here?
|
|
Fri Jan 23, 2004 12:21 am |
|
 |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Re: Notification Events and Actions in COM |
|
If I close and reopen, it still shows the Notification Event Finish set to yes, but still does not run that unless I uncheck and recheck it : I don't think the GUI always refreshes automatically when properties are : updated from a script. If you close and restart the scheduler does the : Properties tab show the Notification Event Finish set to Yes for this job?
|
|
Mon Jan 26, 2004 11:35 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
Here is the command for the COM SetJobProperty("674", "MSG_FINISH", "Y") I just tried it in 3.4.16 and worked fine for me. I also tried running JAL script JobModify("674", "MSG_FINISH", "Y") and it also worked. Which version are you running? : If I close and reopen, it still shows the Notification Event Finish set to : yes, but still does not run that unless I uncheck and recheck it
|
|
Tue Jan 27, 2004 10:07 am |
|
 |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Re: Notification Events and Actions in COM |
|
I'm running the command SetJobProperty(NewJobID, "MSG_JOB", "Y") where NewJobID is the ID of the job that has just been created, and am also using version 3.4.16 : Here is the command for the COM SetJobProperty("674", : "MSG_FINISH", "Y") : I just tried it in 3.4.16 and worked fine for me. I also tried running JAL : script JobModify("674", "MSG_FINISH", "Y") : and it also worked. : Which version are you running?
|
|
Wed Jan 28, 2004 8:17 pm |
|
 |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Re: Notification Events and Actions in COM |
|
I have just discovered that if the job is already created, and then I set the MSG_ properties it works fine. However if I create the job, and then set the properties immediatly after I have created it, it does not work. : I'm running the command SetJobProperty(NewJobID, "MSG_JOB", : "Y") where NewJobID is the ID of the job that has just been : created, and am also using version 3.4.16
|
|
Wed Jan 28, 2004 8:24 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
I don't see any problems here. Is the value of NewJobID correct? Does it work for old jobs? Try enabling the trace (Trace parameter for the OpenSession method). If you don't see any obvios problems in the trace please email your trace file to support. : I'm running the command SetJobProperty(NewJobID, "MSG_JOB", : "Y") where NewJobID is the ID of the job that has just been : created, and am also using version 3.4.16
|
|
Wed Jan 28, 2004 8:53 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
Then the question is the new job enabled or disabled? If it is disabled, it is not in the active job pool. In this case you may need to fix and enable the job first before you do other things.. Is the NewJobID value correct? : I have just discovered that if the job is already created, and then I set the : MSG_ properties it works fine. However if I create the job, and then set : the properties immediatly after I have created it, it does not work.
|
|
Wed Jan 28, 2004 8:58 pm |
|
 |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Re: Notification Events and Actions in COM |
|
I have just checked and double checked and the NewJobId is correct, and yes the job is enabled. As I said in an earlier post everything in the job property box is filling in OK, it just isn't working when I execute the job. : Then the question is the new job enabled or disabled? If it is disabled, it : is not in the active job pool. In this case you may need to fix and enable : the job first before you do other things.. : Is the NewJobID value correct?
|
|
Thu Jan 29, 2004 7:42 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
Oops.. I was sure the problem was with the Properties, at least you said so in http://www.softtreetech.com/cgi_bin/config.cgi?read=4702 I am totaly confused now. Can you please describe again what isn't working. : I have just checked and double checked and the NewJobId is correct, and yes : the job is enabled. As I said in an earlier post everything in the job : property box is filling in OK, it just isn't working when I execute the : job.
|
|
Thu Jan 29, 2004 11:17 pm |
|
 |
Duncan
Joined: 22 Jan 2004 Posts: 13
|
|
Re: Notification Events and Actions in COM |
|
no worries, it is a bit confusing! If I create a job in the 24x7 GUI and set the properties, the job executes its finish event fine. If I have a job created in 24x7 and then set the properties via COM, the job executes the finish event ok. However, if I create the job via COM, and then when it has returned the job ID, I set the properties via COM it does not execute the Finish event. If you then look at this job in the 24x7 GUI, it looks as though all the properties are set correctly, but they do not execute. Would it be helpful if I write a vb6 app to show you what I am doing and send you the code? : Oops.. I was sure the problem was with the Properties, at least you said so : in http://www.softtreetech.com/cgi_bin/config.cgi?read=4702 : I am totaly confused now. Can you please describe again what isn't working.
|
|
Sun Feb 01, 2004 8:02 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: Notification Events and Actions in COM |
|
Please email your code to support@softtreetech.com and also paste http://www.softtreetech.com/cgi_bin/config.cgi?read=4731 link as a reference. : no worries, it is a bit confusing! : If I create a job in the 24x7 GUI and set the properties, the job executes : its finish event fine. : If I have a job created in 24x7 and then set the properties via COM, the job : executes the finish event ok. : However, if I create the job via COM, and then when it has returned the job : ID, I set the properties via COM it does not execute the Finish event. If : you then look at this job in the 24x7 GUI, it looks as though all the : properties are set correctly, but they do not execute. : Would it be helpful if I write a vb6 app to show you what I am doing and send : you the code?
|
|
Mon Feb 02, 2004 8:27 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
|
|
|