Difference between Terminator and Exception Handler stages
Moderators: chulett, rschirm, roy
Difference between Terminator and Exception Handler stages
I have 2 questions:
1)The Exception Handler CAN be used to execute a path (other job activities and execute command stages) in the job sequence after a certain exception occurs. Right?
2)An Exception Handler CANNOT be connected to a job activity/execute command activity stage whereas a Terminator can only be connected to a job activity/execute command activity stage, Right?
Thanks to anyone who responds.
1)The Exception Handler CAN be used to execute a path (other job activities and execute command stages) in the job sequence after a certain exception occurs. Right?
2)An Exception Handler CANNOT be connected to a job activity/execute command activity stage whereas a Terminator can only be connected to a job activity/execute command activity stage, Right?
Thanks to anyone who responds.
Exception Handler is for Unhandled Exceptions. Suppose you've a sequence of job activities. Each job actvity (called a DataStage Job) and trigger next job if the <JobName>.$Status = 1 (Finished) , But what if previous job aborted ?
In such situations exception handler can handle those unhandled exceptions in a job sequence or Simply you can hook a Terminator stage to the previous job which caused the problem.
If you want to use exception Handler ;
1. Same sequence create another set of links like
Exeception Handler -> Job Activity -> Terminator.
2. In your job activity you can call a job or a routine which handles those unhandled exceptions.
One suggestion: send an email to the support group saying job has been aborted by creating a server routine.
Hope this explains about Exception Handler.
In such situations exception handler can handle those unhandled exceptions in a job sequence or Simply you can hook a Terminator stage to the previous job which caused the problem.
If you want to use exception Handler ;
1. Same sequence create another set of links like
Exeception Handler -> Job Activity -> Terminator.
2. In your job activity you can call a job or a routine which handles those unhandled exceptions.
One suggestion: send an email to the support group saying job has been aborted by creating a server routine.
Hope this explains about Exception Handler.
The Exception Handler does not accept any input links whereas the Terminator stage does.
1)Does that mean that we put the Exception Handler anywhere on the sequencer?
2)Does this mean that whenever an exception occurs, that is an execution status other than OK in a job activity or execute command stage, the Exception Handler is executed? This will probably mean that there can only 1 Exception Handler in the entire sequencer job, right?
3)What would the role of the Terminator stage be?
1)Does that mean that we put the Exception Handler anywhere on the sequencer?
2)Does this mean that whenever an exception occurs, that is an execution status other than OK in a job activity or execute command stage, the Exception Handler is executed? This will probably mean that there can only 1 Exception Handler in the entire sequencer job, right?
3)What would the role of the Terminator stage be?
Yes anywhere. When an exception occurs as explained, the control will be passed on to the exception handler, no matter where it is.abc123 wrote:The Exception Handler does not accept any input links whereas the Terminator stage does.
1)Does that mean that we put the Exception Handler anywhere on the sequencer?
Yes, only one exception handler. Any unhandled exception. If you handled status 1, and 2. Then the control wont go to the exception handler if your job finished with status 2 as you have already handled that. Get the picture.abc123 wrote: 2)Does this mean that whenever an exception occurs, that is an execution status other than OK in a job activity or execute command stage, the Exception Handler is executed? This will probably mean that there can only 1 Exception Handler in the entire sequencer job, right?
To forcefully terminate the sequence job.abc123 wrote: 3)What would the role of the Terminator stage be?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
1)Does that mean that we put the Exception Handler anywhere on the sequencer?
NOT sequencer stage. This just a new path as I explained. Please note that Exception Handler is the first stage in that path ( No Input Links)
Exception Handler -> Jobactivity -> Terminator.
2)Does this mean that whenever an exception occurs, that is an execution status other than OK in a job activity or execute command stage, the Exception Handler is executed? This will probably mean that there can only 1 Exception Handler in the entire sequencer job, right?
Exactly. You got the pount.
3)What would the role of the Terminator stage be?
Abort the sequence
NOT sequencer stage. This just a new path as I explained. Please note that Exception Handler is the first stage in that path ( No Input Links)
Exception Handler -> Jobactivity -> Terminator.
2)Does this mean that whenever an exception occurs, that is an execution status other than OK in a job activity or execute command stage, the Exception Handler is executed? This will probably mean that there can only 1 Exception Handler in the entire sequencer job, right?
Exactly. You got the pount.
3)What would the role of the Terminator stage be?
Abort the sequence
Also, what is the difference between "Executed OK" and <JobName>.$Status = 1? I would think that "<JobName>.$Status = 1? (Finished)" is the same as "Executed OK and/or Execution finished with warnings".
Goto the Triggers
Select Custom Expression
Under Expression box right-mouse select Activity Variable
Click on your job actvity, you might see $JobName, $JobStatus, $UserStaus
Where
$JobStaus =1 Finished Ok
$JobStaus =2 Finished Ok( with warnings)
Goto the Triggers
Select Custom Expression
Under Expression box right-mouse select Activity Variable
Click on your job actvity, you might see $JobName, $JobStatus, $UserStaus
Where
$JobStaus =1 Finished Ok
$JobStaus =2 Finished Ok( with warnings)
2 more questions:
1)
The 3 parameters, stage_label.$ErrSource, stage_label.$ErrNumber and stage_label.$ErrMessage, do they
get logged automatically in the log for the sequence job? I would assume that the Message Text in the
Terminator Activity stage also gets logged.
2)
How do you raise an error to test the error handling process?
1)
The 3 parameters, stage_label.$ErrSource, stage_label.$ErrNumber and stage_label.$ErrMessage, do they
get logged automatically in the log for the sequence job? I would assume that the Message Text in the
Terminator Activity stage also gets logged.
2)
How do you raise an error to test the error handling process?
1)
stage_label.$ErrSource. This is the stage label of the activity stage that raised the exception (for example, the job activity stage calling a job that failed to run).
stage_label.$ErrNumber. Indicates the reason the Exception Handler activity was invoked, and is one of:
1. Activity ran a job but it aborted, and there was no specific handler set up.
-1. Job failed to run for some reason.
stage_label.$ErrMessage. The text of the message that will be logged as a warning when the exception is raised
2) You can abort a job which is invoked by job activity. For example suppose you're connecting to a database stage, just give a wrong user id or password for the DB stage, then that job will aborted and Exception handler will handle the situation.
stage_label.$ErrSource. This is the stage label of the activity stage that raised the exception (for example, the job activity stage calling a job that failed to run).
stage_label.$ErrNumber. Indicates the reason the Exception Handler activity was invoked, and is one of:
1. Activity ran a job but it aborted, and there was no specific handler set up.
-1. Job failed to run for some reason.
stage_label.$ErrMessage. The text of the message that will be logged as a warning when the exception is raised
2) You can abort a job which is invoked by job activity. For example suppose you're connecting to a database stage, just give a wrong user id or password for the DB stage, then that job will aborted and Exception handler will handle the situation.
Thanks,
Upul
Upul
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
An Exception Handler can be connected to anything. The Exception Handler may be triggered by failure of an activity for which no explicit failure handling is provided. An Exception Handler can only have an output, never an input. It is analogous to a signal handler in C.
A Terminator activity can be connected from anything. It must be the final activity in its sequence of processing. That is, a Terminator activity can only have an input.
A Terminator activity can be connected from anything. It must be the final activity in its sequence of processing. That is, a Terminator activity can only have an input.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
If you have 3 job activity stages in the Sequence job, and even if we handle the failure for 1 of the 3 jobs, the Exception Handler will NOT be triggered.
For the Exception Handler to be triggered, there cannot be ANY exception handling in any stage in the Sequence.
Also End the Exception Handler stage with a Terminator Activity stage to cleanly handle the failure (means the Seq job will show an Aborted state)
For the Exception Handler to be triggered, there cannot be ANY exception handling in any stage in the Sequence.
Also End the Exception Handler stage with a Terminator Activity stage to cleanly handle the failure (means the Seq job will show an Aborted state)