WhereScape 3D includes the ability to execute scripts for source system discovery, data profiling and customized workflows. The three types of scripts available are:
Browse scripts, for browsing and discovering various source systems.
Profiling scripts, for data profiling of source systems.
Workflow scripts, for streamlining and configuring custom workflows.
All scripts used by WhereScape 3D can be written and defined on the script and template manager.
Defining script languages
WhereScape 3D offers functionality for managing and defining scripts, allowing users to implement scripts in different scripting languages like Python, Perl, PowerShell, etc. 3D users can use different types of script languages for the various script-based processing that they perform within 3D.
This feature also supports both importing a set of host script language definitions into 3D from an external source, and exporting host script languages defined in 3D to a file. This enables users to migrate and reuse script language definitions between different 3D repositories or WhereScape RED environments.
Using the script languages feature involves defining the language properties which includes the command to run and execute a script in the defined language.
To create and maintain script language definitions, click the settings icon next to the script language drop-down on the script and template manager. This opens the Script language maintenance screen:
Icons | Description |
---|---|
Add a new script language called 'Script Language <number starting from 1>'. | |
Create a new script language with the same configurations as the currently selected script language named '<Existing name>_Copy', | |
Delete the currently selected script language. | |
Move the currently selected script language up one place in the list. | |
Move the currently selected script language down one place in the list. | |
Prompt the user to select a .hsclang file to import new script language settings. | |
Prompt the user to specify a location to save a .hsclang file containing the existing script language settings. |
Script language definitions consist of the following:
Property | Description |
---|---|
Name | The name for the script language, as displayed in the drop-down fields for selecting the script language. |
Description | The description of the host script language which is for display purposes only. |
File Extension | The file extension used when the scripts are written to files, for example py for Python script files. If this is left blank, the generated files will have no extension. |
Command | The command to execute a script in the defined language. The token $SCRIPT_NAME$ is replaced with the full path and file name of the script file to execute. For example, "C:\Program Files\Python37\python.exe" "$SCRIPT_NAME$". The defined path must be valid for all 3D clients that are required to execute scripts for the defined script language. |
Script Execution
WhereScape 3D shows a progress dialog when executing scripts. Click the‘Details’ button to expand the progress dialogue and display all output from the script being executed. This gives a convenient place for users to view any success or error messages returned by the script.
Further information about the script execution process can be found in the scripts working directory. The working directory is located in ‘%UserProfile%\WhereScape\3D\scriptExecution\temp’. To assist with debugging if the script execution fails, the following files are stored in the working directory.
The scripts that were executed by WhereScape 3D.
A ‘.bat’ file that WhereScape 3D used to execute the script. This file contains the values of any environment variables provided by WhereScape 3D.
A ‘.err’ file containing any error messages returned from the script.
A ‘.aud’ file containing any other output from the script.
Environment variables
A selection of environment variables are made available to all scripts executed from within WhereScape 3D.
Variable | Scope | Description |
---|---|---|
WSL_SRCCFG_<configured_field_name> | Browse & Profiling scripts | The name for the script language, as displayed in the drop-down fields for selecting the script language. |
WSL_CON_JSON | Profiling Scripts | The full path to a file containing the output fro the most recent browse script execution. |
WSL_BINDIR | All Script types | The WhereScape 3D installation path. (The default location is 'C:\Program Files\WhereScape\WhereScape 3D'.) |
WSL_WORKDIR | All Script types | The working directory where the script is executed. (The working directory will be in %UserProfile%\WhereScape\3D\scriptExecution.) |
WSL_TASK_NAME | All Script types | A name used to identify the workflow task. |
WSL_SEQUENCE | All Scripts | A sequence id to identify each workflow process. |
WSL_WRKFL_Repo | Profiling & workflow scripts | The repository name associated with the object selected in the repositories pane. |
WSL_WRKFL_Category | Profiling & workflow scripts | The category name associated with the object selected in the repositories pane. |
WSL_WRKFL_Model | Profiling & workflow scripts | The model name associated with the object selected in the repositories pane. |
WSL_WRKFL_Version | Profiling & workflow scripts | The version name associated with the object selected in the repositories pane. |
WSL_WRKFL_Group | Profiling & workflow scripts | The group name associated with the object selected in the repositories pane. |
WSL_WRKFL_Table | Profiling & workflow scripts | The table name associated with the object selected in the repositories pane. If no table object is selected then the value should be an empty string. |
WSL_WRKFL_Column | Profiling & workflow scripts | The column name associated with the object selected in the repositories pane. If no table object is selected then the value should be an empty string. |