Managing Scripts: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
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.
=== Creating Script ===
# On the left side projects hierarchy, select the project where you want to create a script.
# Open the '''Scripts''' tab.
# Click the '''New''' button and click '''Script'''. Define a name for the script and click '''OK'''. Note that script names must be unique within a project.


== Scripts List==
=== Deleting Script ===
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.
# Select the project where the script(s) to be deleted are located.
# Open the '''Scripts''' tab.
# Select one or several scripts to be deleted.
# Click the '''Delete''' button and click '''Delete''' to the confirmation message.


By default, the following information is displayed for each script:
=== Renaming Script ===
*'''Context Type''': the context to which the script is tied.
# Select the project where the script to be renamed is located.
*'''Name''': the name of the script.
# Open the '''Scripts''' tab.
*'''Group''': the name of the script group.
# Select the script to be renamed.
*'''Tags''': the tags added to the script.
# Click the '''Rename''' button.
*'''Created On''': the date and time when the script was created.
# Change the script name in the opening dialog and click '''OK'''.
*'''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:
=== Moving Script ===
*'''Id''': id of the script in the database.
Scripts can be moved by dragging them with a mouse from the right side list to the target project in the left side hierarchy. Alternatively, you can first select the scripts, then from the right-click context menu select '''Move to''' and finally select the target project.
*'''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.
=== Duplicating Script ===
 
# Select the project where the script to be duplicated is located.
==Managing Scripts==
# Open the '''Scripts''' tab.
* To view or edit the script properties of a script, select the script from the list and click '''Properties'''.
# Select the script to be duplicated.
* 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.
# Click the '''Duplicate''' button. A duplicate of the script is created.
* 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 '''[[QPR_ProcessAnalyzer_Scripting_Commands#--.23WriteLog|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]]
 
[[Category: QPR ProcessAnalyzer]]

Revision as of 18:41, 12 April 2021

Creating Script

  1. On the left side projects hierarchy, select the project where you want to create a script.
  2. Open the Scripts tab.
  3. Click the New button and click Script. Define a name for the script and click OK. Note that script names must be unique within a project.

Deleting Script

  1. Select the project where the script(s) to be deleted are located.
  2. Open the Scripts tab.
  3. Select one or several scripts to be deleted.
  4. Click the Delete button and click Delete to the confirmation message.

Renaming Script

  1. Select the project where the script to be renamed is located.
  2. Open the Scripts tab.
  3. Select the script to be renamed.
  4. Click the Rename button.
  5. Change the script name in the opening dialog and click OK.

Moving Script

Scripts can be moved by dragging them with a mouse from the right side list to the target project in the left side hierarchy. Alternatively, you can first select the scripts, then from the right-click context menu select Move to and finally select the target project.

Duplicating Script

  1. Select the project where the script to be duplicated is located.
  2. Open the Scripts tab.
  3. Select the script to be duplicated.
  4. Click the Duplicate button. A duplicate of the script is created.