Working With Dependencies

Dependencies can be set up on Operations, Steps or Jobs. A Dependency can be set on one object to another (Job B is Dependent on Job A), on a file conditions or a change in an file or directory.  A Job to Job dependency means that Job B cannot execute until Job A completes.

When an object is ready to be run (that is, its Scheduled date and time has occurred), the Executive Server determines if all dependencies have been met. If so, the object is run. Otherwise, the Executive Server will periodically check to see if the dependencies have been satisfied. The object will be displayed in the Status window with a status of "Waiting on dependency" showing the name of the dependency. Once all dependencies have been satisfied the object will be run.
 

File Dependencies

There are two types of capabilities that SmartBatch offers for files dependencies. First, a dependency can be created based on file conditions such as the existence of a file or a string within the file. These dependencies are satisfied when the file exists or the string exists within the file. Operations, Steps or Jobs with this type of file dependency must have a schedule associated with them.  Second, a dependency can be created based on a change in a directory. With this type of dependency the Operation, Step or Job typically does not have a scheduled. The Operation, Step or Job will be processed whenever a change in the directory is detected.

Operation to Operation Dependencies

If you want an Operation to be dependent on another Operation, add both Operations to a Step.  Operations in Steps are processed in the order that they are listed on the Step Properties window.  For example, if you want Operation B to be dependent on the completion of Operation A, add both Operation A and B to a Step and place Operation A before Operation B on the Step Properties window.

Step to Step Dependencies

If you want an Step to be dependent on another Step, add both Steps to a Job.  Steps in Jobs are processed in the order that they are listed on the Job Properties window.  For example, if you want Step B to be dependent on the completion of Step A, add both Step A and B to a Job and place Step A before Step B on the Job Properties window.

Job to Job Dependencies

Job to Job dependencies such as Job B dependent upon the completion of Job A are examined by the Executive Server at run-time. The Executive Server enforces these dependencies and will not allow Job B to run until Job A completes.  This type of dependency is setup on the Dependency Properties window.  

Object to Object Dependencies

An object (i.e., Operation, Step or Job) can be dependent on any other object (i.e., Operation, Step or Job).   The dependent object will not be processed by the Executive Server until the object it depends on has completed within a time frame that you specific.  This type of dependency is setup on the Dependency Properties window.

File Condition and Search String Dependencies

Dependencies such as file existence and search for a string in a file are examined at run-time when the Executive Server is ready to run the Operation, Step or Job. The Executive Server enforces these dependencies and will not allow the dependent object to run until the dependency is satisfied.  A dependency is setup on the Dependency Properties window.

Change In A Directory (File Watch)

A dependency can be created that causes an Operation, Step or Job to be processed whenever a change occurs in a directory. This type of dependency is called a File Watch.  A File Watch dependency is  based on any of the following attributes:

Change in a file name.

Change in a directory name.

Change in a file attribute.

Change in a file size.

Change in the last modified time.

Change in file security.

In addition it can be specified whether all subdirectories should be included when identifying changes.

An example use of this capability is to execute an Operation, Step or Job whenever a file is placed into a directory. This would be done by using the change in file name attribute.

Notes:   If the Operation, Step or Job is currently processing and another change in the directory occurs, the Executive Server will not start the Operation. Step or Job again. The Operation, Step or Job must complete before another change in the directory event will cause it to run again.

The file that caused the change to occur is not know to the Executive Server. The Executive Server is notified by the Windows Operating System of the change, but the actual file that caused the change is not known. If this information is needed, it must be determined programmatically by examining the directory.

A file watch dependency is setup on the Dependency Properties window.   

Adding and Updating Dependencies

Clicking on the Dependency node in the tree view shows a list of Dependencies for the current application in the right list view pane.  Right-click on an Dependency listed in the right list view pane to display available menu items.  

You maintain Dependencies on the Dependency Properties window.