QPR ProcessAnalyzer ScriptLauncher: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
Line 60: Line 60:
</pre>
</pre>


== Connecting through proxy (starting from 2022.6) ==
== Connecting through proxy ==
QPR ScriptLauncher can be used through a manually configured proxy server. Starting from QPR ProcessAnalyzer 2022.6, proxy server is configured using Windows environment variables. Set the proxy server address to environment variable '''https_proxy'''. Environment variables can be set in the '''System Properties''' dialog in the '''Advanced''' tab by clicking '''Environment variables...'''.
QPR ScriptLauncher can be used through a manually configured proxy server. Starting from QPR ProcessAnalyzer 2022.6, proxy server is configured using Windows environment variables. Set the proxy server address to environment variable '''https_proxy'''. Environment variables can be set in the '''System Properties''' dialog in the '''Advanced''' tab by clicking '''Environment variables...'''.



Revision as of 13:25, 31 August 2023

QPR ScriptLauncher is a tool to run QPR ProcessAnalyzer scripts, and enable connections to datasources from the local network where ScriptLauncher is running, e.g., on-premise. In practice, the data extraction commands can use the ExecuteInClientSide parameter to run the extraction commands locally in the network where QPR ScriptLauncher is located.

Installing ScriptLauncher

Follow these instructions to install QPR ScriptLauncher:

  1. Go to https://dotnet.microsoft.com/en-us/download/dotnet/6.0, and download and install .NET Runtime (x64 version for Windows). Note: For QPR ScriptLauncher 2022.8 and earlier releases, download the .NET Desktop Runtime (x64 version for Windows) instead.
  2. Download QPR ScriptLauncher from the downloads page, and extract the package into a suitable location for the ScriptLaucher application files.
  3. If you need to extract data from SAP using the RFC interface, you need to install the SAP NetWeaver RFC Library.
  4. Configure ScriptLauncher according to the instructions in the next chapter.
  5. Installation is now completed. Run scripts using ScriptLauncher by following instructions in the chapter below.

Installing SAP NetWeaver RFC Library

Extracting data from SAP using the SAP RFC interface requires SAP NetWeaver RFC Library 7.50 which can be installed with the following steps:

  1. Microsoft Visual C++ Redistributable Package 2013 is required and can be downloaded from 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.
  2. Download and extract SAP NetWeaver RFC Library 7.50 package by following the instructions in https://launchpad.support.sap.com/#/notes/2573790 (SAP login credentials and permissions needed).
  3. In the extracted files, go to folder nwrfcsdk\lib, and copy all .dll files (icudt50.dll, icuin50, icuuc50.dll, libsapucum.dll, sapnwrfc.dll) to the folder containing the ScriptLauncher application files (e.g. Qpr.ProcessAnalyzer.ScriptLauncher.exe).
  4. Make sure that the dll files are not in the blocked state as follows: Open the each dll files Properties and in the General tab in the Security section, check the Unblocked checkbox (if that checkbox exists). (Downloaded files may be blocked by default by Windows, preventing their code from executing.)

More information about connecting to SAP.

Configuring ScriptLauncher

Before you can start running scripts with QPR ScriptLauncher, you need to configure connection and other parameters to the ScriptLauncher's configuration file appsettings.json located in the ScriptLauncher folder. (Note QPR ProcessAnalyzer 2022.5 and earlier releases use file Qpr.ProcessAnalyzer.ScriptLauncher.exe.config)).

To configure the settings, open the appsettings.json file in a text editor. Note that you need to have write access to the ScriptLauncher folder.

The appsettings.json needs to be a correctly formatted json file, and thus the backslashes and quotation marks in string values need to be escaped as follows: \ → \\ and " → \".

There are following settings:

  • LogOnName: QPR ProcessAnalyzer username. This setting is mandatory.
  • Password: QPR ProcessAnalyzer password. This setting is mandatory.
  • ServiceUrl: QPR ProcessAnalyzer server url, including the server name and the application path, e.g. https://processanalyzer.onqpr.com/qprpa. This setting is mandatory.
  • ScriptId: Script id to run. You can copy the id from the Scripts tab in the Workspace. This setting is mandatory.
  • OutputDirectory: Folder where to store the created CSV export files. If the folder doesn't exist, it will be created. This setting is mandatory.
  • LogFilePath: Log file path for the ScriptLauncher log. The containing folder needs to exist before running the ScriptLauncher and you need to have rights to write to that folder. If the log file is not defined, it will be stored in the same folder as the configuration file.
  • ProjectId: Project id. This setting is optional.
  • ModelId: Model id. This setting is optional.
  • UseLegacyClientSideImport: Defines whether to use the legacy mechanism (true) or the new gateway mechanism (false) to process data extractions in the client-side. The gateway mechanism is needed to use the client-side extraction in the expression language.
  • Parameters: Defines custom parameters that are passed to the script. The script use corresponding @_Parameter_<ParameterName> variables to read the parameters. Example of configuring parameters:
"Parameters": {
  "parameter1": "value 1",
  "parameter2": "value 2"
}

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\"

Connecting through proxy

QPR ScriptLauncher can be used through a manually configured proxy server. Starting from QPR ProcessAnalyzer 2022.6, proxy server is configured using Windows environment variables. Set the proxy server address to environment variable https_proxy. Environment variables can be set in the System Properties dialog in the Advanced tab by clicking Environment variables....

Connecting through proxy (up to 2022.5)

In QPR ProcessAnalyzer 2022.5 and earlier releases, proxy settings are configured to the Qpr.ProcessAnalyzer.ScriptLauncher.exe.config file stored into the QPR ScriptLauncher installation folder.

For example, in order to setup a proxy that uses current Windows credentials for the proxy connection, add the following section inside the <configuration>:

<system.net>
  <defaultProxy useDefaultCredentials="true" />
</system.net>

To configure an explicitly specified proxy server, use the following configuration:

<system.net>  
  <defaultProxy>  
    <proxy proxyaddress="serverip:portnumber" />   
  </defaultProxy>  
</system.net> 

More information: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/proxy-configuration

Exporting Script Results to CSV

When a QPR ProcessAnalyzer script contains the GetAnalysis command with the Show=TRUE parameter or the ShowReport command, the results are exported into a CSV file. Only tabular analysis types are supported by the CSV export. 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