Lesson 7: Operations, Steps and Jobs

Understanding Operations and how they are configured is fundamental in using SmartBatch successfully.

 Jobs are just groupings of Steps that are processed in the order they are configured on the Job Properties window. Steps are groupings of Operations that are processed in the order they are configured on the Step Properties window.  You don’t have to use Steps and Jobs but if you have sophisticated automation processing needs, you will want to take advantage of what they have to offer.

The basic idea is that you want to create your Operations first and then group related Operations into Steps and related Steps into Jobs. You can then assign Schedules, Parameters/Parameter Groups, Dependencies and Alert List as necessary.

This lesson uses the following example to create a Step with three Operations.

Suppose you want to move several (source) files that contain HTML to a different locations. The HTML is updated weekly by your webmaster. You need to save the existing HTML files to a save location and then delete the current (destination) files. You can then move the new files into place. The source HTML files are:

c:\webstuff\products\cameras.htm

c:\webstuff\products\receivers.htm

c:\webstuff\products\tvs.htm

Step 1: Create Parameters

Since there are other files in the c:\webstuff\products folder you explicitly move each file as a separate Operation. The following Parameters (see Lesson 5: Parameters) are used for the Path names:

Parameter Name

Parameter Value

DestinationFolder

d:\webstuff\products

SourceFolder

c:\webstuff\products

SaveFolder

e:\webstuff\products

Create the Parameters above by right-clicking on the Parameters node in the tree view and select the New Parameter menu item.  Enter the Parameter Name, Description and Value.  Click the OK button to add the Parameter and return to the Parameter list.  You can now right-click again on the Parameter node to add the next Parameter.  Do the same for the third Parameter.

Add the Parameters above to a Parameter Group by displaying the Parameter Group Properties windows.  Right-click on the Parameter Groups node in the tree view and select the New Parameter Group menu item.   Enter a name, description and place the Parameters to add to the Parameter Group into the Parameter Group list box. Use the Add button to create the Parameter Group.

Step 2: Create Schedule

See Lesson 3: Schedules for more information on creating a Schedule. You should create a Schedule for this example named HTMLUpdate that runs weekly, every 1 weeks on Sunday.

Step 3: Create Operations

There are a total of nine Operations that need to be added using the Operation Properties window.
Copy the destination files from the previous week to the save location:

Step Name

Description

SaveFiles

Save the original files.

Operation Name

Operation

SaveCamera

cmd.com copy DestinationFolder \cameras.htm SaveFolder\*.*

SaveReceivers

cmd.com copy DestinationFolder \ receivers.htm SaveFolder \*.*

SaveTvs

cmd.com copy DestinationFolder\ tvs.htm SaveFolder \*.*

Delete the current destination files:

Step Name

Description

DeleteFiles

Delete the old files

Operation Name

Operation

DelCamera

cmd.com delete DestinationFolder\cameras.htm

DelReceivers

cmd.com delete DestinationFolder\receivers.htm

DelTvs

cmd.com delete DestinationFolder\tvs.htm

Copy the new source HTML file to the destination location:

Step Name

Description

CopyFiles

Copy the new files.

Operation Name

Operation

NewCamera

cmd.com copy SourceFolder\cameras.htm DestinationFolder\*.*

NewReceivers

cmd.com copy SourceFolder\receivers.htm DestinationFolder\*.*

NewTvs

cmd.com copy SourceFolder\tvs.htm DestinationFolder\*.*

Go to the Operations list by selecting the Operations node in the tree view.  Right-click on the Operations Node and select the New Operation menu item.  Enter the Operation Name, Description and Operation (all other fields are optional). Leave the Parameter Group and the Schedule Name at “<none>“. Add the Operation by selecting the OK button. Repeat this process for each of the nine operations.

Note: You can use copy an Operation by right-clicking on an Operation in the Operations list and selecting the Properties menu item.  The Operation Properties window is displayed listing the selected Operation and its attributes.  The Copy button is adjacent to the Name field.  Click on the Copy button and enter a name for the new Operation.  You can then change the attributes as necessary and click the Apply button to save your changes.

Step 4: Creating Steps

Three steps will be created to save the original files, delete the old files and copy the new files.  The tables above show the three Steps and nine Operations.  Go to the Step Properties window by right-clicking on the Step node in the tree view and select the New Step menu item. The three Operations from the first table above are combined into the Step.  Enter the Step Name and Description. The Operations are assigned to the Step by selecting the Operations (must be done one at a time) from the Operations list and using the right arrow button to add the Operations to the Operations in this Step list.  Repeat this procedure for the second and third Steps.  The Steps will not have a Schedule or Parameter Group assigned.  This will be assigned to the Job which we will create next.

Step 5: Creating the Job

Since you will want the Steps to process in the correct order you will add the three steps to a Job and assign a Schedule and Parameter Group to the Job.  Right-click on the Job node in the tree view and select the New Job menu item.  Enter a Job Name, Description and add the three Steps in the correct order to the Steps in this Job list.

Step 6: Assigning the Parameter Group

The Parameter Group created from Create Parameters (Step 1) above is assigned to the Job by selecting it in the Parameter Group drop down list in the current window (that is, Job Properties window).

Step 7: Assigning the Schedule

Select the Schedule Name “HTMLUpdate” from the Schedule Name drop down list. This was created from Step 2: Create Schedule above.

Step 8: Adding the Job

The Job is added to the database by selecting the OK or Apply button. The Job will be processed by the Executive Server when the Schedule occurs.

Note:  You can execute the Job on demand by right-clicking on the Job in the Job list and select the Execute menu item.  You will be prompted to enter the name of the Step and Operation to start with.  By default, the Job is executed from the first Step and first Operation.

This completes the configuration for the Update HTML example.