QPR ProcessAnalyzer ScriptLauncher
QPR ProcessAnalyzer ScriptLauncher is a tool to run QPR ProcessAnalyzer scripts stored in the QPR ProcessAnalyzer Server. QPR ProcessAnalyzer ScriptLauncher is part of QPR ProcessAnalyzer Excel Client installation package.
Installing ScriptLauncher
Follow these instructions to install QPR ProcessAnalyzer ScriptLauncher:
- Install QPR ProcessAnalyzer Excel Client (either a Complete installation or a Custom installation with QPR Connector selected.
- The ScriptLauncher files are located in the QPR Connector folder which is in the QPR ProcessAnalyzer Excel Client installation folder (e.g. C:\Program Files\QPR ProcessAnalyzer 201X\QPR Connector). If you want to run the ScriptLauncher in a different folder, the QPR Connector folder can be copied into a different location.
- If you need to extract data from SAP using the RFC interface, you need to install the SAP Connector.
- Configure the ScriptLauncher according to the instructions in the next chapter.
- The ScriptLauncher can be run according to the instructions in the chapther below.
Installing SAP Connector for ScriptLauncher
- Go to SAP Service Marketplace (SAP Service Marketplace credentials required), and download SAP Connector for Microsoft .NET 3.0.11.0 for Windows 64bit (x64).
- SAP connector may require Microsoft Visual C++ Redistributable Package. Check the SAP Connector documentation for more information. For example Microsoft Visual C++ 2010 Redistributable Package is available in https://www.microsoft.com/en-us/download/details.aspx?id=14632. Restart your computer after the Microsoft Visual C++ Redistributable Package installation.
- Run the SAP Connector for Microsoft .NET 3.0.11.0 for Windows 64bit (x64) installer.
- Copy the sapnco.dll and sapnco_utils.dll files from C:\Program Files (x86)\SAP\SAP_DotNetConnector3_x64 to C:\Program Files\QPR ProcessAnalyzer 201X\QPR Connector (ScriptLauncher installation folder).
Note: If you get error Could not load file or assembly 'sapnco_utils.dll' or one of its dependencies. The specified module could not be found., the reason might be that the MSVCR100.dll file is missing and solution is install Microsoft Visual C++ 2010 Redistributable Package. If the problem still persists, verify that the MSVCR100.dll is included in windows PATH.
Configuring ScriptLauncher
Before you can start running scripts with QPR ProcessAnalyzer ScriptLauncher, you need to configure the connection and other parameters for the tool. Note that you need to have write access to the ScriptLauncher folder, which contains the ScriptLauncher's configuration file Qpr.ProcessAnalyzer.ScriptLauncher.exe.config.
- Open the Qpr.ProcessAnalyzer.ScriptLauncher.exe.config file in a text editor.
- Within the file, go to the following section starting with <Qpr.ProcessAnalyzer.ScriptLauncher.Properties.Settings> and configure the values for the following parameters:
- ConnectionType: Service (if you are connecting to a service) or Database (if you are connecting to a connection string)
- LogOnName: your QPR ProcessAnalyzer username
- Password: your QPR ProcessAnalyzer password
- ConnectionString: the connection string to the QPR ProcessAnalyzer database (e.g. Server=localhost;DataBase=<database_name>;Trusted_Connection=True)
- ServiceUrl: the URL of your service
- ProjectId: the ID of the project (0 = default)
- ModelId: the ID of the model (0 = default)
- FilterId: the ID of the filter (0 = default)
- ScriptId: the ID of the script you want to run. You can copy the ID from the Manage Scripts dialog in QPR ProcessAnalyzer Excel Client. If ScriptId is 0 (or less than 0), there will be an error written into the log.
- OutputDirectory: the folder where to store the created CSV export file. If the folder doesn't exist, it will be created.
- Parameters: passes defined custom parameters to the ProcessAnalyzer script being run. The script should have corresponding "@_Parameter_<Parameter name>" variables in the script. For example, the following would result in "5" being used in the ProcessAnalyzer script as the value of the variable @_Parameter_AnalysisType:
<setting name="Parameters" serializeAs="Xml"> <value> <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>AnalysisType=5</string> </ArrayOfString> </value> </setting>
Note that it is possible to add more than one string. The type of the parameter value is always NVARCHAR.
The context in which the script will be run depends on the configuration of the parameters for the different ID's listed above in the following order, so that the first found context definition in the configuration file will be used when running the script:
- FilterId (in case the value for this parameter is greater than 0)
- ModelId (in case the value for this parameter is greater than 0)
- ProjectId (in case the value for this parameter is greater than 0)
- The context of the analysis the user has last opened
In case you want to change location of the log file that will be created, you can do that by changing the value of the parameter LogFilePath in the following section of the configuration file:
<applicationSettings> <Qpr.ProcessAnalyzer.Common.Properties.Settings> <setting name="LogFilePath" serializeAs="String"> <value>.\Qpr.ProcessAnalyzer.ScriptLauncher.log</value> </setting> </Qpr.ProcessAnalyzer.Common.Properties.Settings> </applicationSettings>
Note that the log folder needs to exist before running QPR ProcessAnalyzer ScriptLauncher and you must have rights to write to that folder. By default, the log file will be stored in the same folder as the configuration file.
Running ScriptLauncher
After you have configured the parameters as explained in the section above, run Qpr.ProcessAnalyzer.ScriptLauncher.exe which is located in the ScriptLauncher folder. You can also run it from cmd.exe. You need to have RunScripts rights assigned to you in QPR ProcessAnalyzer.
All the supported configuration settings can also be specified from the command line when launching QPR ProcessAnalyzer ScriptLauncher. The command line parameters will override the settings in the configuration file. The parameter names are case sensitive. To specify a setting via the command line, use the following format:
-<SettingName>=<SettingValue>
For example:
Qpr.ProcessAnalyzer.ScriptLauncher.exe -ScriptId=123 -ProjectId=1234 -ModelId=12345 -FilterId=432
Setting values that contain special characters, such as whitespaces, must be escaped by using double quotes. For example:
-LogFilePath="C:\Temp\Path to My Log Files\ScriptLauncherDir\"
Exporting to CSV
When a QPR ProcessAnalyzer script contains the GetAnalysis command with the Show=TRUE parameter or the ShowReport command, the analysis is exported into a CSV file. The name of the exported file will be the same as the Excel sheet name when the script is run using ProcessAnalyzer Excel client. If there are multiple Show commands for a same Excel sheet name, the newer will overwrite the older file(s). Only tabular analysis types are supported by the CSV export. When the script has been run, script progress will be written to the specified log file Qpr.ProcessAnalyzer.ScriptLauncher.log.
The exported CSV files have the following formatting:
- Column separator: semicolon
;
- Decimal separator in numeric fields: period
.
- Quotation character for text fields: double quotes (used when the textual value contains semicolon, double quotes, linebreak or tabulator)
"
- Escape character: Double quotes in textual fields are escaped with two double quotes.
""
- Date format for date fields: yyyy-MM-dd HH:mm:ss,fff
- First line: contains column headers