SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Process / Program Exit Code

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Process / Program Exit Code
Author Message
Sia Lin Chan



Joined: 14 Aug 2000
Posts: 9

Post Process / Program Exit Code Reply with quote

Hello all,

I would like to know how the Scheduler obtains Process Exit Codes from the jobs in the database that are running or have completed (either failed or successful). More specifically, how does the Scheduler get an exit code from a VB program that :
1) is successfully run?
2) was executed but ran into execution error within VB (as opposed to the traditional exit code in C/C++) ?
3) was executed with error within the Scheduler? Could I have a sample RaiseError code in script, please?

Please reply urgently as I am in the middle of software testing that will determine whether if my clients will purchase your Scheduler for their intended project!


Wed Aug 16, 2000 10:00 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Re: Process / Program Exit Code Reply with quote

There is no way to determine if a VB program "logic" failed. If it is not a poorly written program it should log errors to some file or Windows NT event log or inform users by other means. If it is a poorly written program then you are out of lack.

1. There is only one exit code, this is an exit code of the process, it does no matter how and which tool (VB/C/Perls/Java/etc...) was used to implement that process. Every Windows process uses Windows API function ExitProcess to stop running and return some exit code. That's it.
2. See first paragraph in this post
3. The scheduler evaluates all possible error conditions and processes them accordingly. For example, if a semaphore cannot be deleted this causes the job to be marked as failed. As for the RaiseError you can use this statement to force job errors, see example below

Dim file_found
// Check file before loading it to the database
FileExists "c:\\load\\data.txt", file_found
If file_found, LOAD_IT
// File not found, raise error and terminate this job
RaiseError "File c:\\load\\data.txt not found, database load aborted"

LOAD_IT:
... some commands here
: Hello all,

===================================================================
: I would like to know how the Scheduler obtains Process Exit Codes from the
: jobs in the database that are running or have completed (either failed or
: successful). More specifically, how does the Scheduler get an exit code
: from a VB program that : 1) is successfully run?
: 2) was executed but ran into execution error within VB (as opposed to the
: traditional exit code in C/C++) ?
: 3) was executed with error within the Scheduler? Could I have a sample
: RaiseError code in script, please?

: Please reply urgently as I am in the middle of software testing that will
: determine whether if my clients will purchase your Scheduler for their
: intended project!

Wed Aug 16, 2000 10:32 pm View user's profile Send private message
Sia Lin Chan



Joined: 14 Aug 2000
Posts: 9

Post Re: Process / Program Exit Code Reply with quote

Dear Technical Support,

Thanks! I have modified my code to generate an exit code upon failure that is detected by the Scheduler.

Is there any way to kill the current job using the script besides exit? What I am trying to determine is if there is a JAL command to stop a process if an error is encountered? The situation right now is that my JAL script can detect the process exit code and exit the SCRIPT but it still detects the semaphore file that will run the subsequent child process.

I would like the script to stop/suspend/kill/disable the current job (parent process) instead of just exiting the script so that the semaphore files will not be created? Is this possible?

Lin

: There is no way to determine if a VB program "logic" failed. If it
: is not a poorly written program it should log errors to some file or
: Windows NT event log or inform users by other means. If it is a poorly
: written program then you are out of lack.

: 1. There is only one exit code, this is an exit code of the process, it does
: no matter how and which tool (VB/C/Perls/Java/etc...) was used to
: implement that process. Every Windows process uses Windows API function
: ExitProcess to stop running and return some exit code. That's it.
: 2. See first paragraph in this post
: 3. The scheduler evaluates all possible error conditions and processes them
: accordingly. For example, if a semaphore cannot be deleted this causes the
: job to be marked as failed. As for the RaiseError you can use this
: statement to force job errors, see example below

: Dim file_found
: // Check file before loading it to the database
: FileExists "c:\\load\\data.txt", file_found
: If file_found, LOAD_IT
: // File not found, raise error and terminate this job
: RaiseError "File c:\\load\\data.txt not found, database load
: aborted"

: LOAD_IT: ... some commands here

: ===================================================================

Thu Aug 17, 2000 12:28 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Re: Process / Program Exit Code Reply with quote

ProcessKill will do that!

: Dear Technical Support,

: Thanks! I have modified my code to generate an exit code upon failure that is
: detected by the Scheduler.

: Is there any way to kill the current job using the script besides exit? What
: I am trying to determine is if there is a JAL command to stop a process if
: an error is encountered? The situation right now is that my JAL script can
: detect the process exit code and exit the SCRIPT but it still detects the
: semaphore file that will run the subsequent child process.

: I would like the script to stop/suspend/kill/disable the current job (parent
: process) instead of just exiting the script so that the semaphore files
: will not be created? Is this possible?

: Lin

Thu Aug 17, 2000 11:36 am View user's profile Send private message
Sia Lin Chan



Joined: 14 Aug 2000
Posts: 9

Post Re: Process / Program Exit Code Reply with quote

: ProcessKill will do that!

Yes, I know about ProcessKill. ProcessKill with the ProcessGetID will "kill" my 24x7.exe but what I would like it to do is kill the current job.

I have tried to add the path to my current job but I think I might need some enlightment on what is the exact path to kill my job. :)

Thanks.



Thu Aug 17, 2000 9:56 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6513

Post Re: Process / Program Exit Code Reply with quote

ProcessKill will not kill 24x7 if you pass valid process id of other running process. You can use either ProcessGetID, WindowFind with WindowGetProcess or id returned by Run, RunAndWait and RunWithInput statements to get the ID of the process that you want to kill. Please see complete examples for these statements in the on-line help system.

: Yes, I know about ProcessKill. ProcessKill with the ProcessGetID will
: "kill" my 24x7.exe but what I would like it to do is kill the
: current job.

: I have tried to add the path to my current job but I think I might need some
: enlightment on what is the exact path to kill my job. :)

: Thanks.

Fri Aug 18, 2000 8:15 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.