Types of scripts (extension points)

An extension point is where you run a script (Script API). You can replace a Script API with a one-line script that redirects to a Java™ class.

The full list of script types available can be found in the Scripts Console. To access the Scripts Console click Data Model Manager > Scripting > Scripts Console. Although there are various script types available from the Scripts Console, they are all grouped in one of the following types:
  • Data manipulation, cleansing, file formatting, and expression mappings for imports and exports
  • Mass updates
  • Custom validation rules
  • Calculated values
Script extension points are the places where Product Master runs a user-defined script. The following table lists the available extension points:
Table 1. Extension points
Script type Product Master name Description
Report generation script Report script This script is run when the report is generated. Report scripts are used to create custom reports. When you create a report in Product Master, you use scripts to define the report output. The report script is used to define how the information is ordered and formatted.
Run value rule Value rule This script sets values for an attribute. You can also use this script to change the value of an attribute when accessed.
Default value rule Default value rule This script provides a default value for an attribute. Instead of giving a default value for an attribute, you can specify that a script generates the value.
Note: Primary key attribute does not support this rule.
Non-persisted attribute rule Non-persisted attribute rule This script generates a value for an attribute that is not stored in the database. This script runs when you view an item.
Note:

This rule is triggered twice, and the second invocation gets triggered in context of retrieving item view information and the item attribute values cannot be accessed. Before proceeding, always first check if item.getPrimaryKey() is not an empty string.

String enumeration value rules String enumeration rule This script provides a dynamic list of possible values for an attribute. This script returns an array of strings for enumeration. A string enumeration rule, like a value rule or a validation rule, is used within a specification. A string enumeration rule can be used only with attributes of String Enumeration type.
Validation rule script Validation rule This script determines whether an attribute is valid. This script runs when an attribute is validated. A validation rule, like a value rule, is used within a specification. A validation rule is used to validate an attribute-based value on a business rule. A validation rule must return a value of true or false. A value rule is created as a parameter of an attribute in a specification. A value rule calculates the value of the attribute to which it is attached. When an item is created or saved, the value rule is computed.
Workflow step script Workflow step This script affects the In, Out, and Timeout functions for workflow transitions. When you define a workflow step, you can define three scripts (1 script that has 3 functions). IN is run when items move into the step. OUT is run when items leave the step. TIMEOUT is run when items are in the step too long and therefore time out.
Post save script Post save script This script is the last script that is run during a save. Post save scripts are attached to a catalog and hierarchy and are run when an item or category is saved. The post save script operation happens after the record commits to the database.

The refresh data tool sets the post save script for the hierarchy. However, the post save script does not show up in the catalog Entry Categories hierarchy attributes user interface. Therefore, there is a limitation in that the post save script does not display in the drop-down box on the catalog Entry Categories hierarchy attributes page.

Distribution script Distribution script This script provides custom distribution so that you can send messages by your own means. Distribution scripts, for example, Ariba catalog Upload, FTP, HTTP POST, and email, are used to create a custom distribution that is not addressed by the built-in Product Master distributions.
Mutable lookup table loading script Lookup table import script This script runs during the import process. This script populates the lookup tables. Lookup table scripts are similar to aggregation scripts; they are used to populate the contents of a lookup table instead of a catalog. The navigation to access lookup table import scripts is the same as catalog import scripts.
Catalog to catalog export script Catalog to catalog export script This script is set in the Catalog Console from the Catalog main menu. Catalog export scripts are used to complete advanced, "on-the-fly" operations on data that is contained in the catalog before it is exported to an output file. Modifications that are made to the content through the scripting engine at the time of export are not applied to the catalog, but rather applied to the output file as a one-time content modification. All exports require the use of a script. Unlike the import, selecting a script during export cannot be skipped. However, for each new destination spec that you create, three default generated scripts are available to choose from: CSV, tab-delimited, and fixed-width.
Queue sync processing script Queue message processor This script is started by ccd_connectivity/invoke_queue.jsp.
Queue sync script Queue message processor This script is started by the queue manager JVM as a job.
Catalog generation script Catalog export script This script is started by the catalog export function. The catalog export script can complete a comparison of two catalog versions. For each item, the status between the two versions can be accessed. There are four possible types of status: Modified, Added, Deleted, Unmodified.
Import catalog "before" script Import script This script is started by the hierarchy and catalog import function. Import and export scripts are used to import data into and export data out of Product Master.
Run container script Pre-processing and post-processing script When you use Product Master the order of execution of the container scripts is:
  • User creates or edits an entry (item or category).
  • Entries build script runs.
  • Populate sequences and enumerations (only for new entries, primary key first), non-persistent attribute rules.
  • Entry is displayed in the user interface.
  • User initiates the Save function.
  • Pre-processing script runs.
  • Value rules run.
  • Post-processing catalog script runs.
  • Validation rules, enumerations, non-persistent attribute rules.
  • Entry is saved, committed, and persisted.
  • Post-save catalog script runs.
The validation rules that are run after the post-processing script completes.
Run entry build script Entries build script This script is started by the entry build.
Note: The entry build script gets ran twice for every entry build.
Scripting sandbox Scripting sandbox UI This script is started by the PageContent script operation that is started from the sandbox.
Entry preview script Entry preview script This script is started by the entry preview function, as started through the JavaScript library. The entry preview script allows you to create a sample view of a current item set, which can be ran from the data entry screens. For example, you can write a script to view how an item displays when you use an XML format.
WorkListHolder preview marked script Entry preview script This script is started by the entry preview script, as started through the mainline code.
getURL or getContent script Data entry more window script This script allows custom windows to be added to data entry screens that are set through the XML within etc/default/data_entry_properties.xml.
Container preview script Catalog preview script This script is started by the container (catalog) preview function, as started from the user interface. A catalog script is a sequence of operations that you specify to be run at the time of item creation and edit. This function provides another layer of function over the attribute level operations available through the catalog specs.
Custom page script Custom tools This script is a custom Product Master JSP user function. You can create a custom tool, which is a script that outputs a web page and deals with request and response.
Secure invoker and invoker script (Secure) trigger script This script is started through an http URL as an external interface to Product Master. Trigger scripts are created to avoid the need to populate the same script operations in multiple places. Trigger scripts are stored in the document store and can be called from another script function. Trigger scripts externally trigger events in Product Master, for example, imports and exports.
Report search result button script Rich search report script This script is started when you run reports.
Macro entry processor script Entry macro script This script is started from the Macro button in the user interface. A user can run an entry macro script within the data entry screens. For example, you can write a script to replace all strings with a value. This script triggers a post processing script to save modifications, if any, to an item.
Note: Macro supports the asynchronous mode. Macro runs on the EntryProcessor parameters and results are logged through the EntryProcessor status.