Rules Admin – CPQ Online Help

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. Though not quite as user friendly as what Attribute Dependencies offers, the Rules section allows creating complex rules through the use of CPQ tags. It is not prerequisite to be an expert in 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 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 show 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. In the action field would contain:
<*SELATV(Level:high)*>; <*SELATV(Color:Red)*>
or
<*SELATV(Level:high,Color:Red)*>
This tells 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, Attribute Dependencies, or Rules. When using all three, 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:
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 an attribute dependency 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 Attribute Dependency or the Rule.

Simple product rules

In CPQ Setup→ Products, when products are edited under tab ‘Rules’ , 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 legacy editor). Regular rules will be displayed in 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 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 key words (AND, Disallow etc.)

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, 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, 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, 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 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)

Enovia Rules

Enovia is a Product Lifecycle Management (PLM) tool whose purpose is to act as a master data system for setting up products.

CPQ supports Enovia Rules and can be enabled for users on request (email support).

In order to import Enovia Rules into CPQ, an admin user should develop a custom API Interface that will process the data and import it into CPQ.

In order to support multi language translations we suggest you save the rule message in the custom table RuleMessags_Translation via the custom API Interface at the moment of import:

  • Export message dictionary keys from the custom table RuleMessages_Translation
  • Translate them out of CPQ
  • Import translation to this table

Note that the rules are executed at run time, that is at the moment the user runs a product configuration. The syntax of Enovia rules will be checked at the moment of rule import so syntax errors won’t appear to end users.

Message Logic


Once the rule has been executed, a rule message will be shown to end users.

The rule can be executed by either a user or the system, which is why two types of messages may appear:

  1. Info messages - these messages will be displayed when a rule is executed by the system. These messages display information about executed rule actions. They do not make the configuration incomplete and will be displayed from the moment their rules are executed until all rules are triggered again.
  2. Action messages - these messages will be displayed when a rule is executed by a user. These messages tell the user what to select/deselect in order to complete the rule logic and make configuration incomplete. These messages are shown when a rule is broken and they are removed as soon as the rule action has been performed.

Message Translation
All Enovia rule messages will be displayed in English language.
Product rule messages in CPQ will be translated to the user's language.
Translation will be managed in CPQ by the CPQ admin user.
If a certain rule message is not translated, that rule message will be displayed in the way it has arrived from Enovia.

Message Location


Messages will appear in a Responder box (Figure). This is the only place where messages are displayed within product configuration.

Messages will be translated to the user’s language.

Enovia messages will appear in English. The translation of these messages will be managed in CPQ by the central admin. Product managers have the responsibility to detect when new translations are needed, and will request form the central admin to export appropriate translations files. Product managers will then organize correct translations of missing texts. After that, the translated file will be sent to the central admin who will import it into CPQ.

Rules Execution Time in CPQ


Product rules are executed at run time, that is at the moment the user runs product configuration, which includes the following:

  1. When the user finds product in catalogue
  2. When the user opens product configuration
  3. When product configuration is loaded
  4. Once product configuration has been loaded and rules are executed for the first time, the following rules execution triggers will be any kind of change on product attributes:
    • Select
    • Deselect
    • Disallow

CPQ Rule Execution Failure


If during rule execution CPQ cannot perform a rule action for any reason, it means one of the following:

  • Attribute listed in a rule cannot be found in loaded product configuration
  • Attribute values listed in a rule cannot be found in loaded product configuration

The following message will be displayed to the end user: “Rule 'Rule name' cannot be executed. Please contact system administrator.”

When a rule cannot be executed, the system will make the configuration incomplete so that the user cannot create a quote or send the product configuration for verification to Enovia.

A rule execution error in a product will be solved the following way:

  1. The user will contact the CPQ admin user
  2. The admin user will send the following message to Enovia from CPQ: “This product will be demoted in Enovia.”
  3. The CPQ admin can deactivate the product in CPQ if necessary
  4. If a certain product is deactivated, the user won’t be able to find this configuration in CPQ anymore

When a product has been deactivated, its configurations saved in the Favorite section will become invisible to end users.
When a product has been deactivated, the user will be able to access quoted configurations and edit them.
The message will be translated to the user’s language, except the part related to the name of the rule. The name will not be translated in CPQ, meaning that the system will take the original name of the rule in English.
All product rules will be loaded in Developer Console so the admin user will be able to debug any of them in case of error.

Obsolete Features


Attributes in CPQ won’t have effective dates.
As a result, the rule engine does not need to consider effective dates in rule execution.

Rule Errors


Syntax error

The rule syntax is checked at the moment of product import. Each product rule will be checked before rules and the entire product are saved in CPQ.
The product will be saved in CPQ only when all product rules are syntactically correct.
Due to the syntax check of each rule, importing the product will not be instant and can take some time, depending on the size of the product data sent.
If there is at least one rule with the syntax error, CPQ will return a message about the error found and the product won’t be saved.
All product rules will be traced in CPQ Developer Console.

The CPQ Admin user will be able to follow up on all product rules and debug rule execution directly in CPQ.

Forbidden Characters


Quotation marks (”) - this character cannot be included in attribute name, attribute value or any booked word because it would result in rule execution failure. Syntax error also occurs when this sign is missing from rule logic.

Split operator: Tilde sign “~” – this character can be present as a variable, as an attribute and/or attribute and its values.

Double colon (::) - this character cannot be included in either the attribute name, attribute value or any booked word because it would result in rule execution failure.

Characters that are not allowed as part of attribute names include the following: ” # $ @ % * , ? \ < > [ ] | : ( )

You are here: CallidusCloud CPQ Online HelpAdmin Page HelpProduct AdministrationProductsRules Admin