Attribute Related Binds

The Attribute Related binds allow access to the selected object or value. Many binds can be attribute related, however the binds listed below are available after selecting the 'Attribute Related' option within the 'Binds to' dropdown, as shown below.

Each bind is defined in the sections below.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule or Library topic here.
  2. Edit the business rule as defined in the Editing a Business Rule topic here.
  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic here.
  4. In the Edit Operation dialog, optionally add Messages, as defined in the Adding a Localized Business Rule Message topic here.
  5. In the Edit Operation dialog, add JavaScript to call the bind.

Note: Example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system

Attribute

The selected attribute is bound to the variable.

In this example, the Variable Name is 'eanAttribute', the Binds to field is Attribute, and the Parameters field displays the EAN attribute. The following JavaScript returns the ID of the EAN attribute as an Info log message:

var bindDemo = eanAttribute.getID();
log.info("Attribute ID is " + bindDemo);

Attribute Group

The selected attribute group is bound to the variable.

In this example, the Variable Name is 'displayAttrGroup', the Binds to field is Attribute Group, and the Parameters field shows the Display attribute. The following JavaScript returns the ID of the Display attribute group as an Info log message:

var bindDemo = displayAttrGroup.getID();
log.info("Attribute Group ID is " + bindDemo);

Attribute Validated Parameter

For more information, see the Parameterized Business Actions in Web UI section of the Web UI Getting Started documentation here.

Attribute Value

The value of the selected attribute is bound directly as a String variable. Primarily used for Web UI live validation of conditions and when defining Match Codes.

Note: This variable also works in the Web UI.

In this example, the Variable Name is 'primaryColorAttrValue', the Binds to field is Attribute Value, and the Parameters field displays the Primary Color attribute. The following JavaScript returns a message when the value of the Primary Color attribute does not match the expected value of 'Gray':

return primaryColorAttrValue == "Gray" ? true : "Primary Color is " + primaryColorAttrValue + " but it should be Gray.";

List of Values

The selected LOV (called 'Domain' in the workbench) is bound to the action or condition variable.

For example, to add one more color 'violet' to the 'Colors' LOV.

//lov =Bindes to List of Values
//node= Current Object
lov.createListOfValuesValue("violet",null ,node.getID());

Unit

The selected unit is bound to the action or condition variable.

For example, to add one more size 5 cm to the 'Size' LOV.

//lov= Binds to List of Values
//node=Current object
//unit= Select the unit which you want to bind (cm, m , g/cm^2 etc)
lov.createListOfValuesValue(5, unit ,node.getID());

Unit Group

The selected unit group is bound to the action or condition variable.

2018, Stibo Systems