Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

Business Rules and Constraints (BRC)

Concept

Before going deeper into the different processes that allow you to create and manage different kinds of projects in the Designer, you first need to learn about Constraints, about Constraint Propagation and about Business Rules & Constraints (BRC).

UNDERSTANDING CONSTRAINTS

CPQ is a constraint-based engine, meaning that the business rules are expressed as constraints. Now what exactly is a constraint?

Definition: A Constraint Satisfaction Problem is defined as::

A set V of variables v

A set of domains D(v) for each v  V

A set C of constraints c on a subset V(c)  V that defines/restricts the combination of values which are acceptable for these variables.

Definition: A Domain will express the initial set of possible values for a given variable.

To put it simpler, a constraint satisfaction problem will define a problem to be solved as well as the conditions that must be respected by a potential solution.

Definition: A Constraint will express a relationship between 2 or more variables that defines the accepted as well as the rejected combinations.

It should be clear that a constraint is not a rule. Indeed, a rule will define a group of actions or decisions to undertake based on a certain state. This means that a rule will allow you to easily calculate results based on a certain input. However, rules cannot guarantee the correctness of the eventual result (the final decision once all rules have been applied). Moreover, a rule is directional:

although it specifies how to go from one state to another, it does not state how to go back.

This is where the constraint engine comes into play, and where the power of CPQ becomes evident. Constraint propagation will allow broadcasting of the influence of a user decision (the chosen value) on all other values in the configuration by browsing all involved relationships. In the end, it will guarantee that the configuration is in a stable state, which means that the result is an acceptable solution.

UNDERSTANDING CONSTRAINT PROPAGATION

In order to fully understand the concept of constraint propagation, let’s have a look at the following example.

Suppose that we have 2 variables in the system, which are called “color” and “number”. The following scheme shows the domain for each variable, as well as the constraint that specifies the possible combinations between the 2 variables:



When this situation is given to the constraint engine, it will identify that, based on the current state, and based on the currently known constraints, the color “Black” will never be possible, and the numbers “0” and “4” will not either. This situation can be graphically illustrated as follows:



Suppose that the user chooses the color “Blue”. Once the color “Blue” has been chosen, the constraint engine will immediately deduct the impact on the domain of the number, and will thus decide that in the current state, the number “3” is no longer possible:



There’s only one choice left for the user. Suppose he chooses the number “1”. In this case, the constraint engine will automatically identify that the number “1” is not compatible with the color “Green”, and it will issue the following state:



In this case, the user can change indifferently between 2 remaining colors and the 2 remaining numbers because both Red and Blue are compatible with the number “1”, and both are compatible with the number “2”. Suppose the user changes the color to “Red”:



Understanding BRC

DEFINITION

Now that you understand what a constraint is and how it works, let’s have a look at BRC.

Definition: Business Rules & Constraints (BRC) are used for 3 purposes::

Domain BRC are used to specify the list of possible values for a variable by defining a domain

Filtering BRC will define a constraint on one or multiple variables in order to filter or reduce the domain for each variable

Calculating BRC will “calculate” a unique result. These BRC are typically used during the “generative processes”, or also during the configuration in order to calculate a particular attribute (min, max, number of instances, etc.).

THE “ARCHITECTURE” OF A BRC

The following picture shows the internal representation of a BRC:



A BRC can basically be interpreted as a function, which has an input part, a content and

an output part.

Input Aliases

Definition: Input Aliases are the variables that are used to trigger the BRC execution and to provide domains or values to the BRC Content.

Typically, each alias has:

  • A name, which uniquely identifies it in the context of one and only one BRC.
  • A CPE, which “links” the alias to a variable in the configuration tree.
  • A flag that indicates if the alias MustExist before the BRC can be executed.
  • A flag that indicates if the alias MustBeAnswered before the BRC can be executed.
  • A type, which determines if it is text, numeric, etc.
    information: The aliases for which at least one flag has the value “true” is considered to be a “trigger” of the BRC.
    information: In the case of a Macro Language BRC, the aliases will be used as local variables in the Macro Language.

Output aliases

Definition: Output Aliases are the variables that are used to build the constraint to be applied.

An output alias has the same criteria as an input alias.

Tip: If an output alias is marked as “MustBeAnswered before the BRC is executed”, the BRC will be executed as an “a posteriori check”, which will validate (or invalidate) the chosen value for the attribute corresponding to that alias.

BRC Content

The BRC Content represents the business logic that will determine the possible combinations between different values for each output alias, based on the values and domains given for the input aliases.

Understanding the different types of BRC

There are five ways to express BRC content:

  • A Matrix
  • A Formula
  • A Product Filter
  • A Business Macro
  • A SQL Statement

MATRIX BRC

A Matrix BRC will enable you to specify the list of possible combinations of the values for all aliases in the BRC. In the case of a Matrix BRC, all input aliases are potentially also output aliases.

The general representation of a matrix will allow specifying the exact combinations, e.g.:

ALIASCOLOR ALIASNUMBER EXPLANATION
= RED < 2 EXP001
= BLUE IN {2,3}
NOT IN {RED, BLUE} BETWEEN [4..5]

The matrix also allows you to provide on the fly business explanations.

Tip: Use a matrix whenever all possible (or incorrect) combinations can be listed exhaustively.

FORMULA BRC

A formula is a Macro Language based expression used to evaluate a condition, e.g.:

For a domain BRC, as in a calculation:

outputAlias1 := inputAlias1 + inputAlias2

or

For a filtering BRC, as in a post-control:

outputAlias1 <> outputAlias2

Tip: Use a formula whenever an unconditional calculation needs to be executed or whenever a comparison needs to be performed between 2 variables.
Warning: Formulas can only execute whenever all input aliases have been answered. This means that each input alias must have the “must Exist” and “must Be Answered” flags set to “true”.
Note: this also means that the “IsDefined” statement does not make sense in a formula.

PRODUCT FILTER BRC

A Product Filter enables you to search for standard items in the CPQ repository based on the following options:

System properties

  • This option allows you to specify search criteria such as the item name, description or parent.

Business properties

  • This option allows you to specify the product characteristics to which matching standard items should respond

Pricing attributes

  • This option allows you to specify price ranges to which the targeted standard items have to correspond

Example 1: a domain returned by macro

DEFINE sampleMacro()

IF inputAlias=”RED”

LET outputTable[0,0] ”outputAlias” /* Define the output alias */

LET outputTable[1,0] “A” /* first domain value */

LET outputTable[2,0] “B” /* second domain value */

LET outputTable[3,0] “C” /* third domain value */

LET outputTable[”NR”] 3 /* number of values in the domain */

LET outputTable[”NC”] 1 /* number of aliases returned */

DISPLAY “outputTable” /* This returns the domain */

END_IF

END_DEFINE

Example 2: a calculation returned by macro

DEFINE sampleMacro()

LET myResult … /* This contains the calculation logic */

DISPLAY myResult /* This returns the result to the output alias */

END_DEFINE

Example 3: a filtering BRC defined by a macro

DEFINE sampleMacro()

LET outputTable[0,0] ”aCharacter” /* Define the output alias */

LET outputTable[0,1] ”aNumber” /* Define the output alias */

LET outputTable[1,0] “A” /* first combination, first column */

LET outputTable[1,1] “1” /* first combination, second column */

LET outputTable[2,0] “B” /* second combination, first column */

LET outputTable[2,1] “1” /* second combination, second column */

LET outputTable[3,0] “C” /* third combination, first column */

LET outputTable[3,1] “2” /* third combination, second column */

LET outputTable[”NR”] 3 /* number of combinations in the domain */

LET outputTable[”NC”] 2 /* number of aliases returned */

DISPLAY “outputTable” /* This returns the domain */

END_DEFINE

Example 4: A macro with operators DEFINE cstWithOperators() LET tab[0,0] "criterion1" LET tab[0,1] "criterion2" LET tab[0,2] "criterion3"

DEFINE cstWithOperators()

LET tab[0,0] "criterion1"

LET tab[0,1] "criterion2"

LET tab[0,2] "criterion3"

/* First column uses operators */

LET tab[0, 'OP'] "true"

/* Second column also uses operators, even if it's just for one cell */

LET tab[1, 'OP'] "true"

/* Third column uses plain values, so the 'op' declaration is optional */

/* Declare a matrix with 3 columns and seven rows */

LET tab["NR"] 7

LET tab["NC"] 3

/* Column 1 contains integer operators */

LET tab[1,0] opBetween(Integer("1"), Integer("10"))

LET tab[2,0] opBetween(Integer("11"), Integer("99"))

LET tab[3,0] opBetween(Integer("0"), Integer("50"))

LET tab[4,0] opGt(Integer("50"))

LET tab[5,0] opLt(Integer("25"))

LET tab[6,0] opGt(Integer("25"))

LET tab[7,0] opGt(Integer("0"))

/* Column 2 contains string operators */

LET tab[7,1] opInside("A", "B")

/* Column 3 contains plain strings */

LET tab[7,2] "AB"

DISPLAY "tab"

END_DEFINE

A Business Macro also allows you to provide business explanations.

Tip: Use a Business Macro whenever the other BRC types are not possible. This typically happens when you need to express a “IF…THEN…ELSE” statement or a “WHILE” loop, or if you need to access Business Data Tables.
Warning: Macros can only be triggered by input aliases which respect the following criteria:

The input alias has the flag “must Be Answered” set to “true”

Or

  • The input alias has the flag “must Be Answered” set to “false” AND the associated form property (or its quantity or comment) has the flag “immediate propagation” set to “true” (as of version 7.1 SP4)

SQL BRC

A SQL BRC enables you to run a SQL query on multiple Business data tables to output a list of possible combinations of values for all aliases in the BRC. (i.e. to output a table similar to a Matrix BRC where all operators are "=")

This type of BRC is particularly useful when you are using business data table as a way to store multiple constraints in 1 single entity.

It allows you to reuse a given BDT and generate multiple constraints based on the same data source.

Example :

I have 2 tables to administrate my configurable product logic.

  • First table identifies which size is eligible for a particular Sales channels
  • Second table identified which type of service is compatible for a particular product size.

Those tables are uses in 2 configurable products. A CP-Webversion only sold from the Web , another CP-Reseller only eligible to my resellers.

Here are 2 BDTs that I maintain :

"Channel Eligility" BDT contains which product size is sellable for a partcular channel



"Size Type" BDT contains which type of product is compatible with a given size



I will then create 1 SQL BRC to handle the constraint between my product type and size for the CP-Webversion and another one for the CP-Reseller

For CP-Reseller

SELECT cType , cSize

FROM SizeType S

INNER JOIN ChannelEligibility C

ON S.cSize= C.cSize WHERE cChannel='Reseller'

For CP-Webversion

SELECT cType , cSize

FROM SizeType S

INNER JOIN ChannelEligibility C

ON S.cSize= C.cSize WHERE cChannel='Web'

As an example, when executing the CP-Reseller, the following constraint will be active (being the result of the SQL statement) :

OUTPUTALIAS1_TYPEOPERATOR "=" OUTPUTALIAS2_SIZEOPERATOR "="
Basic S
Intermediate S
Basic M
Intermediate M

How to model BRC

You will see in the following chapters of this user guide that the BRCs can be used to specify numerous attributes. In many steps, most of the modeled attributes can be associated to a BRC.

Warning: The BRCs can only be created from the steps that use them. Most of the time, the output CPEs will be automatically deduced by CPQ from the property you are defining.

THE REPRESENTATION OF BRC IN DESIGNER

There are 2 ways to represent a BRC, once it has been associated to an object or to an attribute.

Column-based representation

The column-based representation shows a column per BRC. Each BRC column can simultaneously control several characteristics of the element (identified by ticking the corresponding checkboxes)

Example: In the ‘Structure / Control’ step (Configuration Process project), a single BRC can control both the Existence and the Visibility of an element.



Cell-based representation

The cell-based representation places the BRC in a particular cell.

Example: In the ‘Access Rights’ step (Configuration Process project), a BRC will be used to override the existence of a form property.

HOW TO CREATE A NEW BRC

Select the step where the BRC must be added, for example: the "Structure / Build" step of a Configuration Process.

Column-based representation

  • Click on ‘Add BRC’ on the table header
  • [In the popup]
    • Enter the Name and Description
    • Select the BRC Type in the combobox
    • Click on OK
    • The BRC is created and appears in the header of your table
  • [In the content table]
    • Tie the BRC to its output parameters by ticking the corresponding checkboxes.
  • [In the menu toolbar]
    • Save
Cell based representation
  • [In the content table]
  • [In the popup]
    • Enter the Name and Description
    • Select the BRC Type
    • Click on OK
    • The BRC is created in the cell and tied to its output parameter.
  • [In the menu toolbar]
    • Save

HOW TO REUSE AND REFERENCE AN EXISTING BRC

Column-based representation

  • [Via ‘Filter Objects’ explorer]
    • Retrieve the BRC you want to use
  • Drag & Drop the BRC into the header of the table corresponding to the output parameters
  • Tie the BRC to its output parameters by ticking the corresponding checkboxes
  • Save
Cell Based Representation
  • [Via 'Filter Objects' explorer]
    • Retrieve the BRC you want to use
  • Drag & Drop the BRC into the cell corresponding to the output parameter
  • Save

HOW TO REMOVE A BRC

Column-based representation
  • Click directly on the BRC menu next to the BRC Name
  • Choose Remove in the menu
Cell-based representation
  • Click directly on the BRC Name
  • Choose Remove in the popup
When you remove a BRC, 2 things can happen:
  • If the BRC is still used by another object, it will be simply untied from its parent object.
  • If the BRC is not used by another object, a popup window will ask you to 'Delete' the BRC permanently, or to 'Keep' it in the repository for later reuse, in which case it will become an "orphan".

How to design a BRC

The BRC is fully defined in the step “BRC Dictionary”, which is available in every process involving BRC.

Warning: It is not possible to create a BRC from the ‘BRC Dictionary’ step. The BRC are created directly from the steps using them as seen in the section above.

HOW TO OPEN OR EDIT A BRC

There are 2 methods to open a BRC in order to edit it:

Method 1

  • [Via a working area containing the BRC you want to open]
    • Open the BRC menu next to the BRC Name
  • Choose 'Open BRC' in the menu
  • You are automatically redirected to the 'BRC Dictionary' step. The working area contains the selected BRC information.

Method 2

  • [Via 'BRC Dictionary' step – 'Explore BRCs' explorer]
    • Retrieve the BRC you want to open in the explorer. Click on the BRC container in the upper pane of the explorer
  • Select the BRC you want to open in the Lower pane of the explorerThe working area now contains the selected BRC information

HOW TO COPY-PASTE A BRC

In order to copy-paste a BRC, proceed as follows:

  • Open the BRC menu next to the BRC Name in the column header or in the cell which references the BRC you would like to copy and choose copy BRC
  • Navigate to the step in which you would like to create a new BRC and open the object of interest
  • Click on the column header (for a column-based BRC representation) or in the cell of interest (for a cell-based BRC representation) and choose paste BRC.
  • Enter the necessary name & description.

Alternatively, you can duplicate a BRC immediately by doing the following:

  • Click on the BRC name in the column header or in the cell which references the BRC you would like to copy and choose copy/paste BRC
  • Enter the necessary name & description
    • The BRC will be created in the dictionary (and can be retrieved using the "filter objects" explorer")
    • In a column-based BRC representation, a column will immediately be added for the newly created BRC

SPECIFYING THE BRC PARAMETERS

Providing the System Properties

The following table describes the parameters associated to the BRC:

FIELDREQUIREDDESCRIPTION
WorkspaceYesThe Workspace in which the BRC has been created. It is automatically generated and cannot be modified.
NameYesThe identifier of the BRC. The length of the name is limited to 64 bytes and is preferably readable. It is recommended to adopt a coding rule for names, e.g. have them start with a small letter and use a capital letter for every new word. Example: brcControlStructure
DescriptionYesThis is the BRC description, which can be up to 4000 bytes.
TypeYesPossible Values: Matrix: lists combinations of valid (or invalid) values that will define or filter the domain for each output alias. For each alias, an operator can be specified. Formula: represents a Macro Language-based expression. Macro: a Macro Language-based BRC to express complex or specific rules by using the CPQ macro language. SQL: express a SQL query on linked BDT tables. The SQL query must return combinations of valid (or invalid) values that will define or filter the domain for each output alias - it basically returns the content of a Matrix BRC with "=" as operators. Product Filter: returns one or multiple products from the CPQ repository, based on product-related selection criteria (E.g. business properties).
Result TypeYesThis property indicates if the list of values returned by the BRC content corresponds to possible combinations of the output aliases (‘Include’) or the incorrect combinations (‘Exclude’)
Auto LoadYesIn a “normal” situation, the value of this flag is “true”, which means that whenever a BRC is loaded by the CPQ engine, all related input and output aliases will also be loaded (and thus the entire structure necessary to attain these aliases). Can be “set” to false for performance tuning, in which case the execution of the BRC will be delayed until all aliases have been loaded by the user.
FIELDREQUIREDDESCRIPTION
Dynamic MacroYesIn a “normal” situation, the value of this flag is “false”, which means that the BRC will output a list of possible combinations to the CPQ engine. If set to “true”, the macro will be able to input and output CPE by bypassing the notion of input and output aliases. This means that the macro itself will have to check the existence of these CPE. The result of a dynamic macro is not a constraint to be read “by line”, but a group of “mono-alias constraints” (the output is read by the CPQ engine on a per column-basis).
Warning: Do not change the value of the “auto load” flag or the “dynamic macro” flag unless advised to by PROS Software Customer Service.

Providing the Input and Output Aliases

The Aliases table will list the Input and Output aliases that are used by the BRC content or to trigger the BRC.

By default, when associating a BRC with a specific attribute, the Designer will automatically generate the alias corresponding to this attribute. Subsequently, you can add, delete or modify aliases in the ‘BRC Dictionary’ step.

How to add a new Alias in a BRC

[Via the ‘BRC Dictionary step – Parameters sub-step – Aliases section] Add a CPE by either one of the following methods:

How to add a new Alias in a BRC

[Via the 'BRC Dictionary step – Parameters sub-step – Aliases section] Add a CPE by either one of the following methods:

Method 1: Using the CPE Explorer

  • Click on the explorer tab "Explore CPE's"
  • Drag and drop each CPE that is involved in the BRC to the table.
    • Each time a CPE is dropped on an empty line, a new line is created in the Aliases table

Method 2: Using the CPE Builder

  • Click on the Aliases table cell to which you would like to add a CPE
    • A popup "CPE Builder" appears
  • Use the combobox in order to sequentially construct the CPE
  • Click on OK

Specify the alias parameters

FIELDREQUIREDDESCRIPTION
NameYesThe Alias Identifier. It is recommended to adopt a coding rule for names, e.g. have them start with a small letter and use a capital letter for every new word. Example: alias1ControlStructure Warning: The alias names only support the following ASCII characters: The first character has to be a lower case or upper case alphabetical character (a..z or A..Z) All subsequent characters have to be either alphabetical characters (a..z or A..Z) or numerical characters (0..9) or an underscore. (Workspaces can exceptionally involve a dash).
CPEYesThe CPE that is pointing to the attribute designated by the alias.
FIELDREQUIREDDESCRIPTION
Must ExistYesPossible Values: Checked (default value): indicates that the variable associated to the CPE must exist before the BRC is executed. This is for required aliases. Unchecked: indicates that the variable associated to the CPE does not have to exist when the BRC is executed. This can be practical for variables that do not always exist. Important: In order for a BRC to execute, the existence of each input alias will have to be determined! This means that certain BRC could be “on hold” until the existence rule(s) associated to one or more input aliases have issued “true” or “false” respectively.
Must Be AnsweredYesPossible Values: Checked (default value): indicates that the variable associated to the CPE must be answered (= have a value) before the BRC is executed. This is for required aliases. Unchecked: indicates that the variable associated to the CPE does not have to be answered when the BRC is executed. This can be practical for optional variables.
TypeYesPossible types: Basic types: text, long text, Boolean, integer, number, date, url Complex types: object, used for objects in the repository such as standard items or business values When possible, the Designer will infer the type of the Alias from the CPE you have selected Important: the basic types cannot be translated. If you need to construct an internationalized model, please use Business Values (or Standard Items) when constructing domains.

How to delete an existing Alias in a BRC

  • [Via the 'BRC Dictionary' step – Parameters sub-step – Aliases section]
    • Select the table line corresponding to the Alias to delete.
  • [Via the Table toolbar]
    • Click on 'Delete line' function.
  • Save

HOW TO SPECIFY THE BRC CONTENT

How to specify a Matrix BRC

  • [Via the ‘BRC Dictionary step – Business Logic sub-step]
    • Fill in the matrix
  • Save

In the matrix, the following columns are displayed:

FIELDREQUIREDDESCRIPTION
OperatorYesThe following operators can be used: For every alias type Equal (alias = value) Not Equal (alias <> value) In (alias in {value 1, value 2, …}) Not in (alias not in {value 1, value 2, …}) For integer, numeric, monetary and date aliases Less than (alias < value) Less than or equal to (alias <= value) Greater than (alias > value) Greater than or equal to (alias >= value) Between (value 1 <= alias <= value 2) < value < (value 1 < alias < value 2) <= value < (value 1 <= alias < value 2) < value <= (value 1 < alias <= value 2) For text-based aliases Like Not Like Warning: For list-based aliases, only the “equals” operator can be used.
AliasYesThis is the value to be entered by the user. If a domain has already been defined by a Matrix BRC for the corresponding alias, the domain will be automatically shown and you can choose a value amongst the domain values. However, you can still enter another value.
ExplanationNoThis cell allows you to specify the name of the Business Explanation that you want to provide to the user if the combination is applied. For more information about business explanations, refer to Providing Business Explanation.
information: If the Alias type is ‘Object’, 2 additional columns are created in the matrix (Workspace and Type). They allow targeting of a product contained in a specific workspace and/or to add new Business Values that you will create on the fly by completing the Alias column.

Definition: A Business Value is a text-based reusable reference that is translatable. Rich media objects can be associated to it.

How to specify a Formula BRC

  • [Via the ‘BRC Dictionary step – Business Logic sub-step]
    • Enter the formula.
  • Save.

How to specify a Macro BRC

In order to access the macro, proceed as follows:

  • [Via the ‘BRC Dictionary step – Business Logic sub-step]
    • The Business Macro opens”
  • [In the macro content]
    • Specify the macro
  • [In the menu toolbar]
    • Execute the “check” function.
      • If the function returns an error, correct it first before saving
  • [In the menu toolbar]
    • Save
In order to use an input or output alias in the macro, proceed as follows:
  • [In the macro content]
    • Position the cursor where the alias needs to be inserted
  • [In the "Parameters" map]
    • Locate the alias to be inserted (via its name or CPE available in the tile) and click on the alias tile
      • The alias is inserted in the macro body using the position of the cursor
  • [In the menu toolbar]
    • Save
In order to create a child macro, proceed as follows:
  • [In the explorer toolbar]
    • Click on the "New Business Macro" function
  • [In the popup]
    • Specify a name and a description
    • Click "OK"
      • The newly created child Business Macro appears in the Child macro map
  • [In the menu toolbar]
    • Save
In order to open a macro, proceed as follows:
  • [In the macro map]
    • Click on the macro to be opened
  • [In the popup]
    • Choose "Open macro"
    • Click "OK"
      • The selected macro is opened
In order to delete a child macro, proceed as follows:
  • [In the macro map]
    • Click on the child macro to be deleted
  • [In the popup]
    • Choose "Delete macro"
    • Click "OK"
      • The child macro is deleted

Reference: For more details, please refer to the CPQ Macro Language – Reference Manual.

How to specify an SQL BRC

In order to access the SQL BRC, proceed as follows:

  • [Via the ‘BRC Dictionary step – Business Data sub-step]
    • Attach the BDT that you will use as a data source for your SQL query (see Using Business Data Tables chapter below)
  • [In the BRC content]
    • Specify the SQL query
  • [In the menu toolbar]
    • Execute the “check syntax” function.
    • If the function returns an error, correct it first before saving
  • [In the menu toolbar]
    Save:

    Information: The SQL statement must comply with the following guidelines :

    1. The SQL request is a SELECT and only a SELECT query
    2. The SQL request used to build the final constraint table must only take static statements.

      Indeed, the SQL request is executed only once and not on a per-session basis i.e. the constraint returned by the SQL statement behaves like a Matrix BRC BUT its content does not change during a configuration session.

      The SQL BRC can be seen as a different way to configure and maintain a Matrix-typed BRC

      As a result, the SQL request must not leverage the value of one of the alias in a WHERE Clause.

    3. The selected items in the query needs to be mapped to the aliases of the brc. Either those aliases share the name of the column being selected, or the selected item will need to be associated to a label in the sql query.

      In the example below, the labels aTemp and aVol corresponds to aliases of the BRC

      SELECT` `temperature ``AS` `aTemp, volume ``AS` `aVol ``from` `bdtPerfectGas

      ``WHERE` `pressure = 1

How to specify a Product Filter BRC

  • [Via the ‘BRC Dictionary step – Business Logic sub-step]
    • Specify the Product Filter.
  • Save.

By default, a product filter contains system properties, allowing to look up products in the repository based on their name, workspace, collection or parent information. However, the real power of product filters lies in the extensions: each product filter is capable of looking up products based on not only system properties, but also business properties, pricing information and even product links.

How-To: In order to use the collection of the product as a search criterion, fulfill either the Collection workspace or the Collection name (or both) in the system properties. The searched collection(s) is the one built during the design phase, with no runtime constraint or access rights applied. Besides, only the collection is searched and not its potential sub-collections.

How-To: In order to add business properties as search criteria, look up the corresponding Business Property Set in the “Filter Objects” explorer and drag & drop it into the product filter.

The BPS can be used to filter based on BPS values carried by either:

  • Standard Items: drag and drop into the “System Properties” grid
  • Product Links: drag and drop into the Product Link grid
    How-To: In order to add prices as search criteria, look up the corresponding Pricing Method in the “Filter Objects” explorer and drag & drop it into the product filter:

How-To:

In order to add product links as search criteria, lookup the corresponding Product Link type in the “Filter Objects” explorer and drag & drop it into the product filter.

As a product link can be dropped several times (in order to express different filtering criteria), a name will have to be given to each instance (in order to uniquely identify it).

For each product link criteria group, all lines need to be activated. Then proceed to the

completion of all 4 characteristics::

Relation: choose Parent Of if the product filter is searching for products which are parent of the products found by the product link which is expressed, Child Of otherwise.

Name: the name of the products which are either parent or child of the products which are to be retrieved by the product filter

Workspace: the workspace of the products which are either parent or child of the products which are to be retrieved by the product filter (Only ‘=’ operator supported)

Class: the type of products which are either parent or child of the products to be retrieved by the product filter. (Only ‘=’ operator supported)

Once all necessary attributes have been dragged & dropped onto the corresponding sections (multiple Business Property Sets can be added, as well as multiple Pricing Methods), they need to be activated in order to participate in the search.

information: The different Business Property and Pricing criteria will be used together, meaning that an “AND” operator will be used to combine them.

For each activated criterion, the following fields are presented:

FIELDREQUIREDDESCRIPTION
ActiveYesIndicates if the current line is active or not. Only active lines can be updated, and will be taken into account for the product search.
NameYesRepresents the name of the system property, the reference of the Pricing Method range or the Business Property name.
FIELDREQUIREDDESCRIPTION
OperatorYesThe following operators can be used: For every alias type Equal (alias = value) Not Equal (alias <> value) In (alias in {value 1, value 2, …}) Not in (alias not in {value 1, value 2, …}) For integer, numeric, monetary and date aliases Less than (alias < value) Less than or equal to (alias <= value) Greater than (alias > value) Greater than or equal to (alias >= value) Between (value 1 <= alias <= value 2) < value < (value 1 < alias < value 2) <= value < (value 1 <= alias < value 2) < value <= (value 1 < alias <= value 2) For text-based aliases Like Not Like Warning: For list-based aliases, only the “equals” operator can be used.
ValueNoThe fixed value to be used in order to search products based on this search criterion.
CurrencyYesOnly applicable for the pricing criteria. Allows specifying the currency to use when specifying price constraints.
AliasNoAllows using an input alias in order to search products based on this search criterion.

USING BUSINESS DATA TABLES

When you are using a SQL BRC or in some circumstances, when you create a macro-based BRC involving complex rules all the while separating the pure "business data" storage from the macro content, Business Data Tables are a welcome solution.

information: A Business Data Table is a "database table" which can be created immediately in

the Designer. It allows storing business-related data that can be retrieved using SQL queries using a macro-based BRC.

Business Data Tables can only be created using macro-based or SQL BRC. In order to create a Business Data Table, proceed as follows:

  • [In the step “BRC Dictionary”]
    • Make sure that a macro-based BRC has been opened
  • [In the menu toolbar]
    • Click on the sub-step “Business Data”
  • [In the explorer toolbar]
    • Execute the function “New Business Data Table”
    • Provide a name for the Business Data Table
  • [In the table toolbar]
    • Execute the function “Stucture / Add Column” as many times as necessary. For each column:
    • Provide a name
    • Provide a type
    • Provide a length
  • [In the menu toolbar]
    • Execute the function “Add Index” as many times as necessary. For each index:
    • Provide a name
    • Indicate if the index is unique
    • Indicate the columns involved in the index
  • Save.
In order to open and update an existing Business Data Table, proceed as follows:
  • [In the step "BRC Dictionary"]
    • Make sure that the parent BRC has been opened
    • Click on the sub-step "Business Data"
  • [In the Business Data Table map]
  • Locate the Business Data Table
    • Click on it and choose "open table" in the popup
    • [In the table content]
      • Update content for Business Data Table cells
      • Insert new lines by using the function "Insert line" in the menu toolbar
      • Delete existing lines by using the function "Delete line" in the menu toolbar
    • Save.

IN-MEMORY BUSINESS DATA TABLE CACHE

In-memory Business Data Table Cache is a feature to create an in-memory database mirroring the business data tables in the modeling data source. The goal is to have better performances when dealing with a significant volume of data in Business Data Tables.

This feature must be activated to be available. Please contact your PROS Customer Representative for more details.

Limitations

  • When enabled, it binds the new in-memory data source to the default channel (1). Existing code using the default channel should switch transparently to the new data source. If necessary, the original data source is still available on channel 9.
  • As an option, you can keep the original data source on channel 1. In that case, the in-memory data source is accessible on channel 9.
  • SQL queries targeting the in-memory data source do not count towards the Maximum number of SQL requests per session (catalog & configurator) per minute governor limit
  • The feature is meant to work with versioning. BDT in working version may become temporarily unavailable during a given session if the cache is flushed.
    • As this feature can consume large amounts of memory, PROS may limit the number of preloaded versions in cache compared to the current governor limit (3).
  • The new in-memory data source runs in MSSQL compatibility mode. The following piece of code is an extract from the H2 documentation:

    # MS SQL Server Compatibility Mode

    # To use the MS SQL Server mode, use the database URL jdbc:h2:~/test;MODE=MSSQLServer;DATABASE_TO_UPPER=FALSE;CASE_INSENSITIVE_IDENTIFIER:

    S=TRUE. Do not change value of DATABASE_TO_LOWER and CASE_INSENSITIVE_IDENTIFIERS after creation of database.

    #

    # For aliased columns, ResultSetMetaData.getColumnName() returns the alias name and getTableName() returns null.

    # Identifiers may be quoted using square brackets as in [Test].

    # For unique indexes, NULL is distinct. That means only one row with NULL in one of the columns is allowed.

    # GREATEST and LEAST ignore NULL values by default. # Text can be concatenated using '+'.

    # Arguments of LOG() function are swapped.

    # MONEY data type is treated like NUMERIC(19, 4) data type. SMALLMONEY data type is treated like NUMERIC(10, 4) data type.

    # IDENTITY can be used for automatic id generation on column level.

    # Table hints are discarded. Example: SELECT * FROM table WITH (NOLOCK). # Datetime value functions return the same value within a command.

    # 0x literals are parsed as binary string literals.

    # TRUNCATE TABLE restarts next values of generated columns. # TOP clause in SELECT, UPDATE, and DELETE is supported.

    # Unsafe comparison operators between numeric and boolean values are allowed.

PROVIDING BUSINESS EXPLANATION

PROVIDING BUSINESS EXPLANATION

Matrix & Macro BRC can provide detailed business explanations that can be modeled inside the BRC.

Once you have defined the Names of the Explanations in the BRC Content, you can click on the Explanation sub-step in order to define the associated descriptions.

Depending on the BRC state, user explanations will be interpreted either as errors or as warnings.

How to define specific explanations in a Matrix

The specific explanations in the matrix are raised whenever a particular combination applies.

  • [Via the ‘BRC Dictionary’ step – Business Logic sub-step]
    • Make sure that the specific business explanation name has been put on the combinations for which you would like to provide an explanation.
  • [Via the ‘BRC Dictionary’ step – Explanations sub-step]
    • Enter the description corresponding to each Business Explanation name.
  • Save.

How to define specific explanations in a Macro

How to define specific explanations in a Macro

Simple Business Explanation

The specific explanations in the Business Macro are raised using the "MESSAGE" keyword.

MESSAGE "This is my message"

If you want to provide a specific, translatable business explanation in a Business Macro, you can directly use an explanation name:

MESSAGE "MES001"

In order to provide a description for that explanation:

  • [Via the 'BRC Dictionary' step – Business Logic sub-step]
    • Make sure that the specific business explanation name has been used by the "MESSAGE" keyword
  • [Via the 'BRC Dictionary' step – Explanations sub-step]
    • Enter the name as well as the description corresponding to each Business Explanation name.
  • Save.

Rich Business Explanations

Rich business explanations can be raised by macro BRCs. They allow returning a Message associated to a critivality level and an associated Form Property.

2 methods are available from the macro language:

public void raiseBusinessExplanation(final String Message, final String Level, final String GotoCPE)

public void raiseBusinessExplanation(final String Message, final String Level, final String GotoCPE, final ArrayList additionalContext)

Example:

confML.raiseBusinessExplanation("my message

1","level3","CPE.wks/CP/myCP.wks/FO/myFO.FP/myFP")

If you want to provide a specific, translatable business explanation, you can directly use an explanation name:

confML.raiseBusinessExplanation("MES001","level3","")

At runtime, when using CPQ UI, the rich business explanations can be stacked and displayed in an information flyer. The messages will be removed or re-applied automatically by the engine depending whether their context is modified. The context of the message consists of the aliases of the BRC, the goToCPE and the additionalContext (which is a list of FO or FP CPEs).

The goToCPE also allows CPQ UI to redirect the end-user to the targeted Form Property.

How to define global explanations for a Matrix

Global explanations are only usable for a Matrix BRC. They are raised whenever a combination is chosen that is not listed in the matrix. For a global explanation, a name does not have to be set up, because there's only one.

How to personalize explanations

The description of business explanations can either be fixed or variable. If you would like to set up a generic business explanation, you can do that using the tag .

Example

Suppose that the BRC has 2 aliases, aliasColor and aliasNumber.

Suppose that a global explanation needs to be raised in the case that the user has chosen an incompatible color and number. The global explanation can be set up as follows:

<alias>aliasColor</alias> is not compatible with the number

<alias>aliasNumber</alias>. Please change at least one of both values!

At run-time, this explanation will issue

Blue is not compatible with the number 3. Please change at least one of both values!

BRC Restrictions

Some restrictions apply to Business Rules and Constraints.

THE USAGE OF “.STATE.COMPLETED”

Do not: The attribute .state.completed cannot be used as an input of BRC. In order to verify if a certain form property has been answered, use the “must Be Answered” flag.

THE USAGE OF “SETTINGS”

Do not: Constraints cannot be used to define a domain or to filter a domain for a “Setting”, because settings are considered to be “static”.

As a consequence, as soon as a BRC Alias points to a Setting value, the value of the Setting becomes fixed/static during the whole session.

NOTE:

When using the getSetting/setSetting confML API:

  • Either the setting you are trying to retrieve has already been loaded as a BRC Alias

    In that case, the getSetting API will return the value that the setting had at the time it has been associated to the alias.

    Any subsequent setSetting call will allow modifying the value of the setting BUT this new value will only be accessible in the resulting XML, at the end of the Configurator session.

  • Or the setting you are trying to retrieve is never used as a BRC Alias

    In that case, you can use getSetting/setSetting API and the getSetting will always return the latest value of the setting

THE USAGE OF “BUSINESS EXPLANATIONS”

Do not: Explanations cannot be used in the case that the “output” of the BRC is the state (“.state.exists”, “.state.visible”, etc.) of an object (of a Configuration Process, Form or Form Property).

THE USAGE OF “.DESCR”

Do not: If you have to use the attribute .descr of a Form or a Form Property entity as an input of a BRC, two cases can occur::

Either you know by design that the description will not be overridden by another BRC. In that case, you do not need to add the description as an input alias of your BRC. Youy just need to use the getObjectByCPE method in the body of your BRC to retrieve the description when required.

Or you know by design that the description can be overridden by another BRC. In that case, you have to declare the CPE of your description as an input alias of your BRC (e.g. CPE.rootCP.FO/myForm.FP/myFP.descr). In addition, you have to make sure that this CPE will be resolved when executing the BRC by setting both MustExist and MustBeAnswered settings for this alias to true.

Specific BRC functions

VALIDATION BRC

The term validation BRC is typically used for a BRC which a posteriori checks the value which has been answered on a form property which does, again typically, not have a domain BRC.

Create a Validation BRC

  • Locate the form property which has to be validated
  • Create a BRC in the step Constraints, associated to the form which holds the targeted form property
  • Make sure that the output CPE flags are set as follows:
    • MustExist = true
    • MustBeAnswered = true
  • Make sure that the BRC type is exclusion
  • Make sure that the BRC result is only displayed whenever the entered value is invalid
  • If necessary, issue a message explaining the error

For instance, a form property which allows entering a zip code would benefit of a macro that checks the validness of the zip code. It would be written as follows:

BRC DictionaryValidateZipCode()

/* one unique alias: aZip = CPE.currentForm.FP/fpZipCode.value */

LOCAL error “0”

IF checkLength(zipCode) > 5

LET error “You have to enter 5 digits”

MESSAGE error

END_IF

IF checkAlphanumerical(zipCode) = “false”

LET error “You have to use numbers only”

MESSAGE error

END_IF

IF error <> “0”

DISPLAY aZip /* Issue the value to be rejected */

END_IF

END_DEFINE

CALCULATING BRC

The term “calculating BRC” can be used for any BRC that outputs a specific unique attribute that cannot hold more than one piece of information (i.e. “simple”) during the configuration, or for any BRC that is used during the “generative processes”.

Calculating BRC have a specific behavior in the sense that, whenever they return only one value, they will not empty the domain but instead “deactivate themselves”.

In order to demonstrate this behavior, let’s have a look at BRC “X”:



If the user chooses the color “Black”, and if the BRC “X” is a filtering BRC or a domain BRC aiming to determine the compatible numbers for that color, BRC “X” will issue no results whatsoever.

Hence, it will indicate that “no numbers are compatible with the color black” and therefore the domain of the “number” will be emptied which implies that the user will not be able to choose a number.

However, if the user chooses the color “Black” and if the BRC “X” aims to calculate the default value for the “number”, it will simply return no default value. Hence, it will indicate that “no default value has been found” and therefore the user will see no default value.

USING SPECIAL CHARACTERS IN MACRO-BASED BRC

In the context of macro-based BRC, it is possible to issue objects using a specific context. In some circumstances, it may arrive that the names of the objects to be issued contain reserved characters ; in this case the name needs to be encapsulated using double quotes:

BRC DictionaryIssueSpecialNames()

LET tab[0,0] "output"

LET tab[1,0] "workspace/SI/aNormalName"

LET tab[2,0] "workspace/SI/a.Name.With.Dots"

LET tab[3,0] 'workspace/SI/"a.Name.With.a/Slash"'

LET tab["NR"] 3

LET tab["NC"] 1

DISPLAY "tab"

END_DEFINE

SPECIALIZING DESCRIPTIONS IN THE CONTEXT OF A SESSION

In the context of matrix-based BRC and macro-based BRC, it is possible to override the description associated to an object (Business Value, Standard Item, Sales Product) with a session-specific description.

In order to provide that specialized description for a matrix, proceed as follows:

  • [In the matrix BRC content]
    • Click on the cell representing the value description.
      • A popup will open up
  • [In the popup]
    • Provide an alternative description to be used in context of the session (the standard description is marked as read-only).

In order to provide that specialized description for a macro, the following syntax can be used:

BRC DictionarypecializeDescriptions()

LET outputTable[0,0] "Alias1" /* Define the output alias */

/* example without special characters */

LET outputTable[1,0] "workspace/BVAL/va001/descr=my first description"

/* example using a character used as a separator */

LET outputTable[2,0] 'workspace/SI/si001/descr="my /second/ description"'

/* example using a double quote */

LET outputTable[3,0] 'workspace/SI/si002/descr=50"" television'

/* example using a double quote and a character used as a separator */

LET outputTable[4,0] 'workspace/SI/si002/descr="50"" /television"'

LET outputTable["NR"] 4

LET outputTable["NC"] 1

DISPLAY "outputTable"

END_DEFINE

Warning: If specialized descriptions contain double quotes themselves, these double quotes need to be doubled. C.f. the above-mentioned example.
Warning: Descriptions can be specialized, but are still specific to one session, meaning that during the configuration, only one description will be issued. This basically means that descriptions can be issued based on external input aliases, but they should not depend on aliases that change value during the configuration session.