Rules Admin

Rules allow creating limitations for the configuration of the product. This ensures that the user is only able to create an accurate and valid configuration of the product. The Rules section allows creating complex rules through the use of SAP CPQ tags. It is not prerequisite to be an expert in SAP CPQ tags, the Code Builder, which can be accessed during the creation of every rule, can help in creating these rules in a user-friendly way.
Each rule is created with a Condition, which determines whether or not the action will run, and an Action, which tells the system what to do when the condition is true. Each rule is, in essence, an IF statement. IF the condition is true, THEN the anything in the action field will run. There are SAP CPQ tags used especially for rules (and triggers, which are discussed in the Triggers section) to create the condition and the action statements. To access the Rules section use the manual method of product definition and select the Rules link under the Current Product drop down. This brings up the Rules Administration screen shown in Figure A.

rulesadminsmb2.jpg

Figure A - Rules List


Existing rules can be deleted or editing by selecting the corresponding symbol next to the rule name. To add a new rule, click Add New at the top of the page. A blank rule definition page will be displayed as shown in Figure B.

rulesadmin.jpg

Figure B - Adding New Rule


Fields highlighted in yellow are required. Click Check next to the condition or action fields to bring up a Code Builder window (see the section on Code Builder ). Click the Save button at the bottom of the screen to save the rule and add it to the list of existing rules. The Rule Name field is used as a reference and small description of the rule. It is recommended to use associative names, such as Processor blocks Memory or Color selects Widget. This makes it easier to find the rule later if it needs to be searched for and edited.
The Description field can be used for additional explanations or notes. This can make it easier for any other administrators to understand what you are doing in the rule or how the rule fits in with other rules and the configuration of the product.
The Condition field is used to restrict the rule's execution for certain situations. Enter any conditioning tag expression into this field. If the evaluation of the string results in true (1), the rule is applied. If the result is false (0), the rule is disabled. Click the Check button to bring up the Code Builder window for help in creating the condition expression.
The Action field is the action that takes place when the rule is executed. Click the Check button to bring up the Code Builder window for help in creating the condition expression. Rank determines the priority of rule’s execution – lowest rank executes first, highest last. Since non-integer rank values are not accepted it is recommended to skip numbers (such as 5, 10, 15… or 10, 20, 30…) to allow for future insertion of new rules. Rule ranking will only make a difference when the rule is affecting. The Active check box manually turns the rule on or off. This is useful for diagnostic or testing purposes.
Start Date and End Date limit the rule activity time works with effectivity dates. An example would be to allow special merchandise during Christmas or any other time of the year the appropriate dates are filled in. Click the calendar icon next to the fields to bring up a calendar pop-up window to assist in choosing a date. Leaving both fields empty means the Rule is “on” regardless of the date.
The best way to create expressions for rules is by using the Code Builder. This simplifies the process and helps ensure that the created expression is free of any syntax errors. When using the Code Builder window for creating Rule expressions, the window will display the two add-on boxes as shown in Figure C.

Figure C - Code Builder


To create an expression, select the attribute value from the left box and then select the action or function from the right box. Click the Insert button to add the created tag to the expression in the main box. Depending on which function or action is chosen, the Attribute or the Attribute Value will be included in the tag. Functions or actions with the suffix ATT apply to an attribute, while those with the suffix ATV apply to an attribute value.

Note: Appendix A contains a list and descriptions of all tags available for rule expressions.
For example, the following expression would be created for a rule which needed to state that when the value Blue in the attribute Color is selected, then the value Red from the attribute Color and the value High from the attribute Level need to be selected:
The condition field would contain:
<*ANYSEL(Color:Blue)*>
This will return TRUE when Blue is selected from the attribute Color. Once the Condition field returns a value of TRUE, the system looks at the Action field and runs that expression. The action field should contain:
<*SELATV(Level:high)*>; <*SELATV(Color:Red)*>
or
<*SELATV(Level:high,Color:Red)*>
This orders the system to select the attribute value (SELectATtributeValue) High and Red in the attribute Level and Color. Both statements in the example are correct. One statement may work better in a certain situation depending on the rest of the expression.
Make sure the Active check box is checked in order for the system to run the Rule.

If <*DisallowAttribute(NameOfAttribute)*> is used, all preselected attribute values will be unchecked.

The Order of Things

While modeling a product you may use different administrative methods of performing actions on attributes to achieve desired results. These may include Triggers or Rules. When using both, you may run into trouble if the actions begin to affect the same attributes. Knowing the order that these actions are run in the system may help you when modeling your product.
The order the system runs these methods is as follows:

Triggers > Rules

Any time the user makes a selection or a product is loaded, these processes are run in this order. This is important because if you create a trigger that selects the Color Red then have a rule created that selected the Color Blue, then Blue will be the final selection despite the rule ranking of either the Trigger or the Rule.

Simple product rules

In SAP CPQ Setup→ Products, when products are edited under tab ‘Rules’, a new table will be displayed called ‘Simple Rules’. This will be a different representation of current “Attribute Dependencies” (entry “Attribute Dependencies will not be removed from the legacy editor). Regular rules will be displayed in the widget called ‘Scripted Rules’.

Product rules

Table ‘Simple rules’ will be displayed if application parameter ‘Display table for simple product rules’ is set to TRUE. This table will contain rules from the current “Attribute Dependencies” table. There will be only one rule per rule set (currently in Attribute dependencies, admin can define unlimited rules per rule set). Attributes and attribute values will be displayed in different color from keywords (AND, Disallow, and so on)

Note that the Simple Rules cannot be exported.

When admin clicks on ‘Add new’ for simple rule, new screen will be displayed where admin will be able to define rule:

Rule name- This field is required. It corresponds to ‘Dependence rule description’ for ‘Attribute Dependencies’.

Created By- This field is populated with information about who and when created the rule. It currently doesn’t exist for ‘Attribute dependencies’

Modified By- This field is populated with information about who and when last modified the rule. It currently doesn’t exist for ‘Attribute dependencies’

Description- This field is not required. It corresponds to ‘Dependence rule long description’ for ‘Attribute Dependencies’.

Rule Importance (Order of Execution)- This field is required. Its default value is 10. It corresponds to ‘Dependence rule rank’ for ‘Attribute Dependencies’.

Start Date- This field is not required. It corresponds to first date in Effective Dates for Attribute Dependencies.

End Date- This field is not required. It corresponds to second date in Effective Dates for Attribute Dependencies.

IF- Admin will be able to look up attributes that are defined for this product through this field. When admin is adding new rule, there will be a text ‘type attribute name or value’ written in grey letters in this field. As soon as admin starts typing attribute name or value, SAP CPQ will start looking for attribute names and value codes that have text that is entered within attributes defined for this product. Text that admin has entered will be displayed in bold. Maximum of 20 results will be displayed. Admin will be able to delete selected attribute name/value code by clicking on x sign. This field is required. It corresponds to conditioning attributes and their values in ‘Attribute Dependencies’

THEN- Drop down will contain 3 entries : Disallow- Corresponds to ‘Disallow’ in ‘Attribute Dependencies’. This is selected by default. Select- Corresponds to ‘Select One’ in ‘Attribute Dependencies’. Reset & Select- Corresponds to ‘Select Only One’ in ‘Attribute Dependencies’. If application parameter ‘Show Allow Option for Simple product rules’ is set to TRUE, option Allow will also be displayed in the drop down (as the last option)

Admin will be able to look up attributes that are defined for this product through the lookup field. When admin is adding new rule, there will be a text ‘type attribute name or value’ written in grey letters in this field. As soon as admin starts typing attribute name or value, SAP CPQ will start looking for attribute names and value codes that have text that is entered within attributes defined for this product. Text that admin has entered will be displayed in bold. Maximum of 20 results will be displayed. If admin has already added one attribute, when she wants to add another field, she will be able to add it only from the list of remaining attribute values of the same attribute. Those values will be displayed as soon as admin clicks in the next field. Admin won’t be able to add values from different attributes in THEN section. When admin starts typing something in the box, SAP CPQ will look only for attribute values of the same attribute. Admin will be able to delete selected attribute name/value code by clicking on x sign. This field is required. It corresponds to dependent attributes and their values in ‘Attribute Dependencies’

Product rules

Page for adding/editing scripted rules will be changed so that condition and action are displayed in the similar way as for simple rules. Instead of ‘Condition’ there will be an IF field, and instead of ‘Action’ field there will be a THEN field. Everything else will rename as it is.

There will be 2 new application parameters added to SAP CPQ Setup → General → Application Parameters → General: 'Display table for simple product rules'(Default value:FALSE) and 'Show Allow Option for Simple product rules'(Default value:FALSE)

You are here: SAP Sales Cloud CPQ Online HelpAdmin Page HelpProduct AdministrationProductsRules Admin