QPR ProcessAnalyzer ScriptLauncher
QPR ProcessAnalyzer ScriptLauncher is a tool to run QPR ProcessAnalyzer scripts stored in the QPR ProcessAnalyzer Server, while enabling connections to datasouces from the site where the ScriptLauncher is running, e.g. on-premise.
Installing ScriptLauncher
Follow these instructions to install QPR ProcessAnalyzer ScriptLauncher:
- Install .Net Framework 4.7.1 or later (https://dotnet.microsoft.com/download/dotnet-framework).
- Download QPR ProcessAnalyzer ScriptLauncher from the downloads page, and extract the package into a suitable location where to place the ScriptLaucher application files.
- If you need to extract data from SAP using the RFC interface, you need to install the SAP Connector for .Net.
- Configure the ScriptLauncher according to the instructions in the next chapter.
- The ScriptLauncher can be run according to the instructions in the chapter below.
Installing SAP Connector for ScriptLauncher
Extracting data from SAP using the SAP RFC interface requires to install SAP Connector for Microsoft .NET 3.0 using the following steps:
- Download SAP Connector for Microsoft .NET 3.0 for Windows 64bit (x64) from SAP Support Portal (https://support.sap.com/en/product/connectors/msnet.html) (login credentials and sufficient permissions needed).
- SAP connector requires Microsoft Visual C++ Redistributable Package 2013 (download: https://support.microsoft.com/en-us/topic/update-for-visual-c-2013-redistributable-package-d8ccd6a5-4e26-c290-517b-8da6cfdf4f10). Restart the computer after the Microsoft Visual C++ Redistributable Package installation.
- Run the SAP Connector for Microsoft .NET 3.0 for Windows 64bit (x64) installer.
- Copy the sapnco.dll and sapnco_utils.dll files from C:\Program Files (x86)\SAP\SAP_DotNetConnector3_x64 (this folder has been created by the SAP Connector for Microsoft .NET 3.0 installation) to the folder containing the ScriptLauncher application files.
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 connection and other parameters for the tool. 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.
- In the file, go to the section starting with <Qpr.ProcessAnalyzer.ScriptLauncher.Properties.Settings> and configure the values for the following parameters:
- Username: QPR ProcessAnalyzer username
- Password: QPR ProcessAnalyzer password
- ServiceUrl: QPR ProcessAnalyzer url
- ScriptId: 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.
- ProjectId: Project id
- ModelId: Model id
- OutputDirectory: folder where to store the created CSV export file. If the folder doesn't exist, it will be created.
- ConnectionType: One of the following:
- WebApi: When connecting to QPR ProcessAnalyzer server using the Web API.
- Service: When connecting to QPR ProcessAnalyzer server using the WCF API (this is a legacy method and will be removed from the software in future).
- Database: When connecting directly to a QPR ProcessAnalyzer database using a database connection string.
- Parameters: passes defined custom parameters to the script. The script should have corresponding @_Parameter_<ParameterName> variables to use the script. Add the following new setting sections to the configuration file to pass custom parameters (parameter1 and parameter2):
<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>parameter1=value1</string> <string>parameter2=value2</string> </ArrayOfString> </value> </setting>
It's possible to add more than one string. The type of the parameter value is always NVARCHAR.
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 ScriptLauncher has been configured, Qpr.ProcessAnalyzer.ScriptLauncher.exe executable file can be run which is located in the ScriptLauncher folder. In addition to the configuration file, all parameters can also be specified in the command line when running the ScriptLauncher. The command line parameters will override the settings in the configuration file. The parameter names are case sensitive. To specify a parameter in the command line, use the following format (note that all custom parameters must start with "Parameter_":
-Parameter_<ParameterName>=<SettingValue>
For example:
Qpr.ProcessAnalyzer.ScriptLauncher.exe -ScriptId=123 -ModelId=12345 -Parameter_MyParameter1=myValue1 -Parameter_MyParameter2="my value 2"
Parameters 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\"
Configuring proxy settings
QPR ProcessAnalyzer ScriptLauncher communicates with QPR ProcessAnalyzer Server using Windows Communication Foundation (WCF). The connection related configurations follow the WCF standard. You can configure proxy settings for QPR ProcessAnalyzer Client by modifying file Qpr.ProcessAnalyzer.ScriptLauncher.dll.config stored into the QPR ProcessAnalyzer ScriptLauncher installation folder. For example, in order to setup a proxy that uses current windows credentials for the proxy connection, you may try to add the following setting inside the <system.net> tags:
<defaultProxy useDefaultCredentials="true" />
Further discussion about proxy setting:
- http://stackoverflow.com/questions/299940/how-should-i-set-the-default-proxy-to-use-default-credentials
- http://stackoverflow.com/questions/17968307/how-to-set-proxy-credentials-to-specific-wcf-client
Exporting Script Results 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