So job "x" (where "x" > "1") can be setup as a "file-watch" job. Such job should be also implemented as a JAL script. First, create a user-defined statement in the Script Library that returns completion status for any given job (assuming it accepts some job ID as an argument and returns a boolean value - True if the job succeeded and False otherwise). This statement can be called by every "x" job to get the status of the parent job(s). This statement would construct dynamic SQL query like (this is SQL Server prototype, you may need to rewrite it for your database server supported syntax) SELECT isNull( max(convert(char(12), end_timestamp)), 'FAILED') FROM batch_control_table WHERE job_id = [some id inserted here] Then the statement would run the query (DatabaseConnect, DatabaseRetrieve, DatabaseGet) and compare the returned value with 'FAILED' If the result = 'FAILED', the statement will return "False", otherwise it will return "True". Every job "x" can first call the statement described above to get the status of parent job(s). If the status is "False" the job can disable itself (using JobDisable) to prevent from subsequent runs untill the problem is fixed and then notify the support person about which job has been disabled and the reason for that to help troubleshot the problem. For example the message could be like 'Job [bla...bla..bla..] has been terminated abnormally because it found that the prior job [bla...bla..bla..] failed. Please enable the job after you resolve this problem'. This message can be sent as an email (MailSend), or as a page (MailSend + email to pager gateway) or as a network message (use Run "NET SEND ..." command) If the returned status is True (which means that the parent job was OK), the job "x" will do what you need it to do. Now, every job that writes to the "Batch Control" table can use similar methods for updating the database (DatabaseConnect, Database Execute "INSERT INTO batch_control_table (job_id, end_timestamp) VALUES ([some id inserted here], GetData()) at the of the job and notify the support person if anything failed). The described scenario is very common and it is used in many organizations as a standard job processing and auditing scenario. 24x7 Scheduler provides all the methods required for such implementation. : I have a series of jobs that run in my daily batch cycle. The trigger for : each of these jobs will be the combination of the successful completion of : the "parent" job (which is obtained by reading a "Batch : Control" database table) and the presence of any number of files. : For example, Job "1" is to be scheduled on weekdays starting at : 5:00 PM. When Job "1" completes successfully, it writes an : ending timestamp to the "Batch Control" table. If the job does : not complete successfully, the ending timestamp will be null. In this : case, a support person should be notified via email that an error has : occurred. : Job "2" should only run when the ending timestamp for Job : "1" is not null and the output files for Job "1" are : present. Subsequent jobs (ie. Jobs "3", "4", etc.) : will use similar dependencies. : What is the best method using 24x7 to schedule the above scenario, keeping in : mind that if an error occurs the support person should be notified? : Thanks.
|