Manually Running a Script

There are several ways to manually run a script: 

  • From the Script Editorselect a script. From the File menu, click Run, and the script will execute.
  • You can assign the script to a Time Series Icon and trigger the run through the icon's shortcut menu.
  • You can add the script to the Scripts window in the Acquisition, Visualization, or Modeling module and click the button to execute the script.

Automatically Running a Script

Running scripts automatically in CWMS is accomplished by scheduling script jobs. From the the Script menu in the main CAVI window, click Schedule Script Job. The Schedule Script Job dialog will open.

Schedule Script Job Dialog

To schedule a script, the CAVI client must be running and logged in as a valid CWMS user. To setup a script to run automatically:

  1. The Job Name field contains the name of the job that will run the script. The job name contains the name of the script, and the start date and start time that you will enter. You can change this name, but it is recommended that you do not change this name.
  2. From the Script name list, you can select the script you wish to run automatically.
  3. In the Location box, you can schedule a script to run on the server or the client.
  4. Enter a starting date in the Start Date cell (i.e., DDMMMYYYY format), and a start time in the Start Time cell. The date and time reference is local time of the computer running the CAVI client (usually your PC), as indicated the time zone ID next to the Start Time box.
  5. The script job can be a single job or a recurring job. By default the job will be a Single Job. If you want the job to be recurring, select Recurring Job and enter the interval you wish the job to recur at in the Repeat every: box. From the list select Minute(s), Hour(s), or Day(s).
  6. Once setup is complete, click OK, and a confirmation message will open telling you that the script has been scheduled. Click OK, and the confirmation message will close, and the Schedule Script Job dialog will close.

Checking the Status of a Scheduled Script

To check the status of an automatically schedule script, from the Script menu in the main CAVI window, click Script Job Status. The Script Job Status dialog will open. 

  1. The Job Name column displays the name assigned to the script job when it was initially scheduled.
  2. The Script column displays the name of the script that is executed with the scheduled job runs. A script can be used in more than one script job at a time.
  3. The User column displays the name of the valid CWMS user that was logged into the CAVI and scheduled the script.
  4. The Status column displays the status of the scheduler (not the script itself). This column will display three states:
    Pending: The scheduler is waiting to start the script job for the first time.
    Successful: The scheduler started the script job successfully.
    Error: The scheduler did not start the script job successfully.
  5. The Interval column displays whether the job was a single execution or a recurring execution (and the interval between executions if relevant). 
  6. The Location column shows whether the job executed on the client or the server.
  7. If the job is recurring, the Date/Time column will display the date and time of the next scheduled execution.

Deleting a Scheduled Script

From the Script Job Status dialog box, select a scheduled script. Under the Job menu, click Delete. A message will open, asking you if you really want to delete this scheduled script. Click Yes, and the message will close, and the scheduled script will no longer appear in the table.