> #### Job chaining

> When you link individual job instances together in a sequence based on the presence of a specific exit code, you are performing job chaining. Using the value of an exit code that occurs in response to a job having been run, you can determine the processes, or control the flow of processes, that occur once one job ends and the next one begins.

> Figure 8–1 shows a simple job chaining scenario involving four job instances: Job Instance A, Job Instance B, Job Instance C, and Job Instance D. Each job instance has an exit code of 0 already defined. The job chaining in this scenario occurs only if the exit code of 0 is recognized at the end of job instances A, B, and C. If any of these jobs concludes with an exit code other than 0, the job chain ends at that point in the process.

> Figure 8–1: Sample job chaining scenario

> If you want to account for more than one exit code condition, you can use a more sophisticated implementation of job chaining known as job chaining with flow control. You can set up one job chain to implement different job chains, depending on the exit code generated by a given job in the chain.

> Figure 8–2 illustrates a sample job chaining with flow control scenario. One of two possible flows is determined based on the value of the exit codes.

> Figure 8–2: Sample job chaining with flow control scenario

> ##### A word about recursion

> You cannot create a job exit action that is self-referencing. Fathom prevents you from creating this type of situation in a job chain. However, Fathom will not detect the situation in which you create a self-reference further down a job chain.

> It is possible for recursion to occur in any other instance in a job chain when the job called is any other number of steps removed from the original job in the chain. For example, Fathom will not be able to detect a self-referencing job in a situation in which Job A references Job B and concludes with a reference back to Job A.

> Recursion is not a potential issue in the example described in Figure 8–1. Each of the job instances in the job chain is uniquely defined. Similarly, recursion is not an issue in Figure 8–2 because only one of the two possible chains in the job flow will be followed.

Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095