You are here:
Setting Up an Attribute Configuration Rule to Modify Attributes Across Line Items
This topic provides an example of how to define a configuration rule in which a parent line item modifies the attributes of a child line item.
In this example, the parent must have a quantity greater than one and an attribute memory size of 16GB.
In this example, you create a configuration rule with one action. Pair the action with a filter to qualify the triggering product that checks the quantity and the memory attribute value. Create configuration rules against the Line item objects (Opportunity Line Item, Quote Line Item, or Order Item). This example is for the Order Item, with a product relationship of type Modify Attributes, and an action parameter JSON describing the actions to be against the target line item.
Verify that the has rule flag is enabled for each attribute with a rule. Failure to set that flag results in the runtime user interface bypassing the required APIs, so the rule will not apply.
Product relationship of type Modify Attributes considerations:
-
The rule supports two attribute modification contexts: Bundle and Cart. Selecting Bundle causes the rule to apply the actions to the related product within the same bundle of the triggering line item. Selecting Cart applies the actions to the related product within the cart.
-
The action parameters JSON can be created using the product configuration procedure editor. Once created the JSON can be moved to the product relationship. Make sure to delete the mock product configuration procedure once the JSON is copied.
-
The rule supports a self action by leaving the related product field empty, the actions are applied to the triggering product.
To create the rule:
- Verify the Prerequisites are Configured.
- Create the Product Relationship.
- Create the Entity Filter.
- Create the Rule in the Vlocity Rule Builder.
Verify the Prerequisites are Configured
Before configuring the rule:
-
Create all the entity filters used within the rule actions.
-
Create all the action procedures used within the rule actions.
Create the Product Relationship
This product relationship defines the triggering product Test Attribute Config Prod which modifies the attributes of the related product Test Attribute Config Prod Child1 in the context of the cart applying the defined action parameters.
For the Actions Parameter field, see Create Action Parameter JSON with Product Configuration Procedure.
Create the Entity Filter
This entity filter is associated with the rule action to qualify the triggering line item that checks if the memory size is equal to 16GB and the quantity is larger than 1.
Create the Rule in the Vlocity Rule Builder
To create the rule:
- Navigate to the Rules tab.
- Click New.
- Associate all the elements with one another.
Create Action Parameter JSON with Product Configuration Procedure
Product relationships use JSON for the action parameters. To generate this JSON, create a product configuration procedure.
Before You Begin
-
Create the required product.
-
Create the required attributes and, if applicable, picklists.
After you save the product configuration procedure, you can view the Action Parameters code on its Details tab. You can copy the code and paste it into a product relationship's Action Parameters field.
-
In the Product Configuration Procedures tab, click New.
To open the Product Configuration Procedures tab, search for it from the App Launcher.
-
Enter a name for the configuration, and select a product.
To search for a product, you must enter at least one character, and then click the magnifying glass icon. You can then select a product from the results, and click Save.
- Select an attribute to modify.
- Click the + button to add a configuration line for the attribute.
- Click Add Action.
-
Select an applicable action.
Action
Description
Constrain
Include or exclude certain picklist entries.
Assign
Assign a value to any type of attribute.
Disable
Disable an attribute of any type.
Require
Mark an attribute of any type as required.
Hide
Hide attribute in the UI. The attribute definition is still in the JSON, but it's hidden from the user.
-
Select the action type, which varies depending on the action.
-
Disable, Require, and Hide have Yes and No options.
-
Constrain has Exclude and Include options.
-
Assign has no action types.
-
-
Select an attribute value.
-
For Constrain, select the attribute to include or exclude.
-
For Assign, enter the value to set for the attribute.
-
Disable, Require, and Hide require no attribute value.
-
- Click Save after you specify all the attribute actions and values for a product.
- In the Details tab for the saved configuration, copy the JSON for the Action Parameters field, and paste it to your Product Relationship.
