Managing Scripts

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search

Manage Scripts dialog shows all scripts accessible to the user based on context selections defined by the Context, Selected User, Selected Project and Selected Model dropdown menu.

Scripts List

The scripts list is accessible via the Run button on the ribbon will show the scripts for the context that was last selected in the Manage Scripts dialog.

By default, the following information is displayed for each script:

  • Context Type: the context to which the script is tied.
  • Name: the name of the script.
  • Group: the name of the script group.
  • Tags: the tags added to the script.
  • Created On: the date and time when the script was created.
  • Created By: the user who created the script.
  • Last Modified On: the date and time when the script was last modified.
  • Last Modified By: the user who last modified the script.
  • Help: the URL of the defined help page for the script.

In addition, the following columns are available but hidden by default:

  • Id: id of the script in the database.
  • Model Id: id of the model to which the script is linked.
  • Model Name: name of the model to which the script is linked.
  • Project Id: id of the project to which the script is linked.
  • Project Name: name of the project to which the script is linked.
  • Script GUID: globally unique id of the script.
  • User Id: id of the user to which the script is linked.
  • Hide Script Details: When selected, only users who have rights to modify the script can see the script code and other details. When unselected, all users who have view permissions can see the script code and other details.

To unhide a column, right click a column title, select Column Chooser from the popup and drag the column to be shown to the desired position.

Managing Scripts

  • To view or edit the script properties of a script, select the script from the list and click Properties.
  • To run a script, select it from the list and click Run. Alternatively, you can run a script by clicking Run on the ribbon and selecting the script to be run from the menu that opens.
  • To create a new script, click New and define properties for the new script.
  • To delete a script, select it in the list and click Delete. You can also delete several scripts at the same time by selecting them all.
  • After making changes to the script properties, click Save to save the changes. You can also press Ctrl + S to save the changes.
  • To discard changes done since the script was last saved, click Cancel Edit.

Terminating Scripts

Scripts can be terminated in the following ways:

  • The user running the script can click the Cancel button when the script is running.
  • The script can use the --#Exit command to stop script execution.
  • A QPR ProcessAnalyzer Administrator user can terminate scripts in the Operation Log.
  • The SQL Server System Administrator can kill the session that uses the script by using e.g. SQL Server Management Studio.
  • The Internet Information Services Administrator can recycle the application pool if the script has caused it to hang. This may also cause other requests by other users being processed at the same time to be aborted.
  • The Windows Administrator can kill the w3wp.exe process processing a problematic script. This may also cause other requests by other users being processed at the same time to be aborted.

Note that terminating a script will not revert any changes the script has already done in the database before the Cancel button is clicked.

Script Run Log

When a script is run, a log about the script run progress is written to a Script Log. The Script Log also contains information about the previous script runs. For example, the log contains the output of the WriteLog and Print commands used in the script, as well as details about possible errors. After a script execution has finished, the Script Log can be seen when clicking the Show Details button in script run dialog.

File:Script log.png