Methods for running events and scripts
All events and scripts are run from within the Automator component of Visualizer. You can select how you want to run an event or script.
From Visualizer, select Database > Automator > < eventname >.
From Automator, select:
- Run > Event Now
- Run > Script Now
- Run > Preview Mode
- Run > Interactive Mode
- Run > Schedule
Running events from Visualizer
We recommend you run events that affect the database (populate, scan for exceptions, summarize, subset, and delete) interactively from Visualizer the first few times so that you can monitor the process. Once you have an understanding of the process, create scripts to run in the background or overnight.
- Click one of the following events from the Automator menu of the Visualizer Database menu to open Automator in interactive mode and display the selected event dialog box:
- Populate
- Scan for Exception
- Summarize
- MAS Filter
- Subset Data
- Delete Data
- Select options as necessary and click OK.
- Automator asks if you're ready to run the event. Click Yes.
Automator displays the script log that re ports the progress of the event. The log displays the time the event started and completes and any warnings and errors that occur during the event. - From the Automator File menu, click Exit to return to the Visualizer main window.
Running events and scripts using preview mode
Preview mode is useful for testing, because the target database directory is not affected. When you run an event or script in preview mode, Automator writes to the script log as if you ran the event or script.
The log lists the databases that would have been populated, the intervals that would have been scanned or deleted, and so on.
For example, if you specify the wrong FTP file mask for a Populate event and run the script in preview mode, the log displays the following message.
To change the FTP file mask databases, double-click the fatal error message in the log that accesses the appropriate dialog box.
- Select Run > Preview Mode . A check mark beside the command indicates that it's in effect.
- Click an event or a script.
Select either Run > Event Now or Run > Script Now.
The following message is displayed:
Preview mode is enabled – the database will not be altered in any way.Are you sure you want to preview the script:
<scriptname> now?- Click Yes.
Running events and scripts using interactive mode
When you run an event or script interactively, Automator asks for confirmation first. Interactive mode lets you verify that only intended changes are made. For example, if a script is going to delete the wrong files, you can stop the run and change the script.
When you access Automator from the Visualizer Database menu, interactive mode on the Run menu is on. When you open Automator directly, interactive mode is off.
- If you did not open Automator from the Visualizer Database menu, select Run > Interactive Mode.
A check mark beside the command indicates that it is in effect. - Click an event or a script.
Select either Run > Event Now or Run > Script Now .
The following message is displayed:To insure integrity, it is essential that the database(s) be backed up prior to running ANY event. Are you sure you want to run the script:
<scriptname> now?- Click Yes.
Running Events now
The Run Event Now is helpful when you're testing an event and looking for immediate feedback. Used in conjunction with Preview Mode and Interactive Mode, it's a powerful tool for debugging scripts.
- Click a script event.
- Do one of the following:
- Select Run > Event Now.
- From the keyboard, press F5.
- Automator displays the script log that re ports the progress of the event. The log displays the time the event completes an d any warnings and errors that occur during the event.
Running Scripts now
The Run Script Now option is helpful when you're testing a script and looking for immediate feedback. Used with Preview Mode and Interactive Mode, it's a powerful tool for debugging scripts.
- Click a script.
- Do one of the following:
- Select Run > Script Now.
- From the keyboard, press F5.
- Automator displays the script log that reports the progress of the script. The log displays the time the script started and completes, and any warnings and errors that occur during the script.
Running scripts with a scheduler
You can schedule scripts to execute outside normal work hours, using resources around the clock. To prevent time conflicts, schedule only one script per night with as many events as needed.
When you open the Schedule Script to Run Later dialog box (Automator > Run > Schedule ), Visualizer searches your directory for one of the following:
- TrueSight Capacity Optimization, Scheduler component of Manager
- Windows Task Scheduler service
If Visualizer finds the TrueSight Capacity Optimization, it defaults to the scheduler component of Manager. If the TrueSight Capacity Optimization Manager console is not installed, it looks for the Windows Task Scheduler service (the service must be started). If both schedulers are available, Visualizer defaults to the scheduler available in the TrueSight Capacity Optimization.
Running scripts with Windows Task Schedulers
You can use the Windows Task Scheduler to schedule Automator scripts to run on a regular basis, during non-work hours. The Windows Task Scheduler is installed with Windows 2000.
Prerequisites for using the Windows Task Scheduler
Before you use the Windows Task Scheduler, you must:
- Make sure you are running Windows IE (installed automatically with Windows 2000; installed when you download IE from the Microsoft Web site).
- Run your script interactively or in preview mode before running it unattended to check for errors, faulty logic, or data corruption.
Scheduling an Automator script with the Windows Task Scheduler
To schedule an Automator Script to run with the Windows Task Scheduler, use the following procedure:
- Select Run > Schedule to open the Schedule Script to Run Later dialog box.
Automator searches your directory for one of the following:
- TrueSight Capacity Optimization, scheduling feature of Manager
- Windows Task Scheduler service
If Automator finds TrueSight Capacity Optimization, it defaults to the scheduling feature of Manager. If the TrueSight Capacity Optimization, is not installed, it looks for the Windows Task Scheduler. If both schedulers are available, Visualizer defaults to the TrueSight Capacity Optimization, scheduling feature of Manager.
- Do one of the following on the Schedule Script to Run Later dialog box.
- Use the script listed in the Script box (default file extension .B1A). Click Browse to select another script.
- Enter the dates you want the script to run. Options include daily, a single date, a range of dates, or a specific day of the month.
Enter the job name, user name, and password.
- Click OK.
You can go into the Scheduled Tasks folder and verify that your script appears in the list of scheduled tasks.
When Scheduler runs the script, Automator produces a text log that contains the same informational, warning, and error messages as the script log. Instead of overwriting the log, it appends each run of the script (as the default). Review the text log with a text editor such as Microsoft Windows Notepad.
Modifying scheduled scripts
You can go into Microsoft Windows Explorer to view and modify tasks scheduled using Automator. Right-click the task and select Properties. This gives you additional scheduling options.
Automating message notification
If you want to receive automatic notification when an Automator script finishes executing, do the following:
- Start Automator.
- Select Options > Notification to open the Notification dialog box.
- Select Notify End of Script Run By Notepad .
- Click OK.
When you set this option, Automator writes the following entry in the visscr32.ini file in your Windows directory:
Notepad = 1
One means that you will be notified every time a script runs, whether or not there are warnings or errors. You can modify that value so that you receive notifications only when there are warnings, errors, fatal errors or some combination of those. The following Automatic message notification table shows the values you can enter and their meaning:
Notepad | Means return |
---|---|
4 | Warnings |
8 | Errors |
12 | Warnings and Errors |
16 | Fatal Errors |
20 | Warnings and Fatal Errors |
24 | Errors, and Fatal Errors |
28 | Warnings, Errors, and Fatal Errors |
The default notification is to execute notepad.exe using the log file path name as the parameter. You can specify an alternative executable or command file in the visscr32.ini file, NotepadApp, to specify the distribution of the batch files containing warnings and errors. The syntax is:
NotepadApp = path_to_executable parameter_prefix
The log file path name is appended to any specified parameter_prefix when the command is executed. For example, to execute the batch command mailfile.bat with the parameters user name and the logfile path name, set the entry in the visscr32.ini file to:
NotepadApp = c:my_apps\mailfile.bat username filename
Related topic