Validating using automation scripts
With the Automation Scripts application, you can create scripts to validate attributes, offerings and carts.
Both Jython and JavaScript are supported for use with the Automation Scripts application.
Attribute validation
- User input validation - When a user enters a value into the field, and tabs to the next field, a
routine is invoked to validate the input. An example of this is validating that an IP address is
entered in the correct
nnn.nnn.nnn.nnn
format. - Data update - Based on the value entered for an attribute, update the values of other attributes on the offering. For example, if a user specifies that DB2 is to be installed, the Admin field on the offering could be populated with the default DB2 Adminstrator value (db2admin)..
Offering validation
- Prepopulation - runs prior to the offering dialog being displayed and allows the script to update fields. An example of this is to populate the user's name based on the log-in information, prior to the dialog being displayed.
- Add to cart - runs when the offering is added to the cart. This type of script allows a user to ensure that attributes that have dependencies on each other were defined properly. For example if a user selected to install MQ, then the MQ install directory must also be filled in before the offering can be added to the cart.
- Submit the cart - runs when the cart is submitted. Each offering is checked to determine if a script exists, and it is run. This also allows a user to ensure dependencies on the offering are correct.
Cart validation
- Cart submission - After the offering "submit cart" validation scripts are run, you can specify an organization-level script to run when the cart is submitted. This type of validation can be used to verify dependencies between offerings. If a specific offering is found in the cart, then another offering is required, for example.