WhereScape 3D includes the ability to execute scripts for source system discovery, data profiling and customized workflows. The three types of scripts available are:

  1. Browse scripts, for browsing and discovering various source systems.

  2. Profiling scripts, for data profiling of source systems.

  3. 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:

IconsDescription

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:

PropertyDescription
NameThe name for the script language, as displayed in the drop-down fields for selecting the script language.
DescriptionThe description of the host script language which is for display purposes only.
File ExtensionThe 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.
CommandThe 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.

VariableScopeDescription
WSL_SRCCFG_<configured_field_name>Browse & Profiling scriptsThe name for the script language, as displayed in the drop-down fields for selecting the script language.
WSL_CON_JSONProfiling ScriptsThe full path to a file containing the output fro the most recent browse script execution.
WSL_BINDIRAll Script typesThe WhereScape 3D installation path. (The default location is 'C:\Program Files\WhereScape\WhereScape 3D'.)
WSL_WORKDIRAll Script typesThe working directory where the script is executed. (The working directory will be in %UserProfile%\WhereScape\3D\scriptExecution.)
WSL_TASK_NAMEAll Script typesA name used to identify the workflow task.
WSL_SEQUENCEAll ScriptsA sequence id to identify each workflow process.
WSL_WRKFL_RepoProfiling & workflow scriptsThe repository name associated with the object selected in the repositories pane.
WSL_WRKFL_CategoryProfiling & workflow scriptsThe category name associated with the object selected in the repositories pane.
WSL_WRKFL_ModelProfiling & workflow scriptsThe model name associated with the object selected in the repositories pane.
WSL_WRKFL_VersionProfiling & workflow scriptsThe version name associated with the object selected in the repositories pane.
WSL_WRKFL_GroupProfiling & workflow scriptsThe group name associated with the object selected in the repositories pane.
WSL_WRKFL_TableProfiling & workflow scriptsThe 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_ColumnProfiling & workflow scriptsThe 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.
  • No labels