Scripting improvements

Scripting functionality has been added to SCP in 2022.07 release. The functionality is enhanced in this release with improved handling of script output data.

Mappings in script definitions enable users to specify the output behavior. Previously, it has been only possible to insert the output records generated by a script to an SCV table. The mapping definitions are extended to support additional output modes in this release, making it possible to delete the existing records in the SCV table before publishing the output or to update existing records.

These new fields are now available in Output mapping definitions:

  • update_mode: Indicates if the output records generated by the script must be inserted to or merged into the specified SCV table. Possible values are Insert or Merge. The default value is Insert. When update mode is set to Merge, there must be a Primary Key (PK) constraint defined on the specified SCV table. This PK constraint is required to determine the columns to use when updating existing records. If Merge is used and no PK column exists on the table, the script run returns with error.
  • delete_mode: Indicates if the existing records in the specified SCV table is to be deleted before saving the newly generated output data. Possible values are Physical or None, wherein Physical indicates records must be deleted. The default value is None.
  • delete_condition: Enables users to specify a condition when deleting the existing records from the specified SCV table. It must contain a valid SQL where clause on the specified SCV table. The records that satisfy the specified condition are deleted from the SCV table. The default value is not available (when the value is not specified, all existing records are deleted). Delete condition can only be specified whendelete_mode is set to Physical.

All these fields are optional. The specified default values are used when not specified in mappings.

In the script definition, it is also now possible to categorize available script definitions using the new Category field. When many scripts exist, the category allows grouping and easy searching of scripts.

The system flag is added to script definitions to indicate if a script is system defined or user defined. Currently no system-defined scripts are delivered.

Note: By default, this feature is enabled. A new role or privilege is not required to access this feature.