Cameleon Process Expressions (CPE)
Concept
Each object manipulated in the Designer, as well as each property of these objects, can be identified by a Cameleon Process Expression designated by the acronym “CPE”.
Definition: A CPE is a structural expression that points to a specific object or to a specific attribute.
The objects and properties that a CPE point to can be internal CPQ objects or user defined objects.
EXAMPLES:
Example 1:
The following example is a CPE that points to a root Configuration Process:
CPE.workspace/CP/rootCPName
Example 2:
The following example is a CPE that points to a Form Property “value”, and will allow attaching a domain to that Form Property (so it will allow defining, for instance, a list of values):
CPE.workspace/CP/rootCPName.workspace/FO/formName.FP/fpName.value
Example 3:
The following example is a CPE that points to the existence of a form, and will typically be used by a Business Rule or Constraint to define whether the form “exists” or not:
CPE.workspace/CP/rootCPName.workspace/FO/formName.state.exist
Example 4:
The following example is a CPE that points to a Sales Breakdown Line, and is typically used to
access attributes calculated by the “Generative Processes” (sales breakdown, pricing, etc.). This example points to the description generated by the codification rule:
CPE.rootCP.gp.SBL/rootLine.codification.productDescription.value
Example 5: The following example is a CPE that points to a Standard Item, and will retrieve the value for a given Business Property:
CPE.workspace/SI/SIName.workspace/BPS/BPSName.BP/BPName.value
Example 6: The following example is a CPE that points to a Setting, and is typically used to access attributes which are passed to CPQ from an external source:
CPE.Settings.Session.Address
Example 7: The following example is a CPE that points to a Standard Item name that is a child of another Standard Item based on a product link relationship:
CPE.workspace/SI/ParentSIName.workspace/PL/ProductLinkName[1].item.name
Example 8: The following example is a CPE that points to a Business Property value in a specific Business Property Set. This Business Property is positioned on a Product Link between two Standard items. The value is retrieved from the child Sandard Item with a Reverse Product Link:
CPE.workspace/SI/ChildSIName.workspace/RPL/ProductLinkName[1].workspace/BPS/bpsName.B P/bpName.value
Example 9: The following example is a CPE that points to a Standard Item, and will retrieve the object (e.g. a Standard Item) that represents a given Business Property of type object. The difference with example 5 is that here the CPE returns an object and in example 5 it returns a value:
CPE.workspace/SI/SIName.workspace/BPS/BPSName.BP/BPName.value.item
OBJECT HIERARCHY
The following schema provides a simplified overview of the CPQ object hierarchy.
CPE Syntax
ABSOLUTE CPE
The CPE is the structural expression which points to a property or an object in the hierarchy. To target the exist value in the preceding figure, you would build a CPE as follows:
CPE.workspace/CP/rootCPName.workspace/FO/FormName.state.exist
This example clearly demonstrates the concept of an absolute CPE. Its generic form is the following:
What follows is an explanation of each part of this expression:
“CPE”
Every CPE starts with the keyword CPE. This keyword is fixed and is required for every CPE.
Path
The Path is the structural expression that navigates through a tree of objects to the specific object that needs to be queried, using multiple sequences of the following format:
Workspace/Class/Name[Instance]
Workspace
This is the name of the workspace to which the object belongs. An object will “belong” to the workspace in which it has been created.
In the path, the workspace is an optional token, because CPQ will search inside the root
Configuration Process (and thus inside a specific workspace) in order to resolve a CPE.
Class
This is the general classification of an object. The following classes can be used:
| CLASS | DESCRIPTION |
|---|---|
| CP | Configuration Process or Guided Selling Process |
| FO | Form |
| FP | Form Property |
| SBL | Sales Breakdown Line |
| PRGM | Pricing Method |
| DSCM | Discount Method |
| DRWM | Drawing Method |
| DW | Business Drawing |
| DWL | Drawing Matrix Line |
| CLASS | DESCRIPTION |
|---|---|
| BRC | Business Rule(s) or Constraint(s) |
| SI | Standard Item |
| SP | Sales Product |
| BPS | Business Property Set |
| BP | Business Property |
| CL | Catalog or Collection |
| TEA | Teaser |
| LA | Label |
| CB | Configurable Bundle |
| SG | Selection Group |
| SE | Selection |
Name
The Name is the identifier that you have used in the Designer to designate the object.
Workspace/Class/”This.Is/my[name]”
Instance
If the object that needs to be queried is a nested object, multiple instances can exist simultaneously. In this case, an instance number can be provided in order to specify which instance needs to be queried.
Definition: A nested object is a looped object, and can be instantiated multiple times.
Example for a specific form property in the second instance of a nested form:
...myWorkspace/FO/foName1[2].FP/fpName1
Attributes
An attribute is the specific characteristic for which the value needs to be retrieved or set. Some characteristics can be retrieved directly; others are organized in attribute groups. The following is a nonexhaustive list of attributes, along with their context.
| ATTRIBUTE | DESCRIPTION | APPLICABLE ON |
|---|---|---|
| state.exist | Defines whether an object exists. | CP, FO, FP |
| state.visible | Defines whether an object is visible | CP, FO, FP |
| state.mandatory | Defines whether an object is mandatory | CP, FO, FP |
| state.updateable | Defines whether an object can be updated | CP, FO, FP |
| state.computed | Defines whether a form property is calculated | FP |
| ATTRIBUTE | DESCRIPTION | APPLICABLE ON |
|---|---|---|
| value | The value of a property | FP, BP |
| value.default | The default value of a property | FP |
| value.qty | The quantity associated to a value | FP |
| value.comment | The comment associated to a value | FP |
RELATIVE CPE
Absolute CPEs are easy to use and to understand, because their structure allows you to intuitively interpret the attribute they’re retrieving. However, most of time these CPE are used to define constraints and rules on your items that are modeled using objects called BRCs (Business Rule and Constraints). In this case, Absolute Expressions somewhat limit the reusability of these BRC. In order to enhance the reusability, Relative CPEs can be used.
In order to fully understand the concept of Relative CPEs, you first must understand how Business Rules & Constraints are executed. Business Rules & Constraints are, at modeling time, attached to an object or an attribute.
Examples:
- The BRC defining the list of values for a form property is attached to the Form Property “value” attribute.
- The BRC defining the existence rule for a form is attached to the attribute “exist” of the Form object.
- The BRC defining the constraint (the compatible combinations) between 2 Form Properties, is attached to the Form or Configuration Process that is the lowest common denominator of both Form Properties.
BRC can thus be attached to either objects or object attributes. These objects or attributes will define the context in which the BRC will be executed.
For instance, BRC_FoAtt is a BRC that is “attached” to the attribute “exist” of a form property. Because of this physical “attachment”, the execution of that BRC will be contextual to that form property attribute. Therefore, that form property attribute will be considered as the current form property, which will allow you to bypass absolute CPEs.
Have a look at the following table:
| BRC | POINT OF ATTACHMENT | ENHANCEMENT |
|---|---|---|
| BRC_Cp | Configuration Process | CPName can be referenced by currentCP |
| BRC_CpAtt | Configuration Process attribute | CPName can be referenced by currentCP |
| BRC_Fo | Form | CPName can be referenced by currentCP FOName can be referenced by currentForm |
| BRC_FoAtt | Form attribute | CPName can be referenced by currentCP FOName can be referenced by currentForm |
| BRC | POINT OF ATTACHMENT | ENHANCEMENT |
|---|---|---|
| BRC_FpAtt | Form Property attribute | CPName can be referenced by currentCP FOName can be referenced by currentForm FPName can be referenced by currentFP |
| BRC_SblAtt | Sales Breakdown Line attribute | SBLName can be referenced by currentSBL |
The following keywords can be used in relative CPEs:
rootCP
Definition: The keyword rootCP designates the root Configuration Process.
The rootCP keyword is applicable to every type of CPE in a Configuration Process.
CurrentCP
Definition: The keyword CurrentCP designates the first Configuration Process encountered during tree navigation, from the BRC upwards.
The currentCP keyword is applicable to CPE used in BRC attached to Form Property attributes, Form attributes, Forms, Configuration Process attributes and Configuration Processes.
CurrentForm
navigation, from the BRC upwards.
The currentForm keyword is applicable to CPE used in BRC attached to Form Property attributes, Form attributes and Forms.
CurrentFP
Definition: The keyword CurrentFP designates the first Form Property encountered during tree navigation, from the BRC upwards.
The currentFP keyword is applicable to CPE used in BRC attached to Form Property attributes.
CurrentSBL
Definition: The keyword CurrentSBL designates the first Sales Breakdown Line encountered during tree navigation, from the BRC upwards.
The CurrentSBL keyword is applicable to CPE used in BRC attached to Sales Breakdown Line attributes.
CurrentDW
Definition: The keyword CurrentDW designates the first Business Drawing encountered during tree navigation, from the BRC upwards.
The CurrentDW keyword is applicable to CPE used in BRC attached to drawing matrices.
CurrentDWL
Definition: The keyword CurrentDWL designates the first Drawing Matrix Line encountered during tree navigation, from the BRC upwards.
The CurrentDWL keyword is applicable to CPE used in BRC attached to drawing matrices.
CurrentItem
Definition: The keywords with a “current” prefix described in the previous chapters allow to reuse BRC by introducing Relative CPEs. To enhance this reusability, the currentItem keyword can be used to replace the other relative keywords where the context so permits.
The classes in the scope of the currentItem keyword are the following:
| CLASS | CURRENT KEYWORD |
|---|---|
| CP | currentCP |
| FO | currentForm |
| FP | currentFP |
| SBL | currentSBL |
| CLASS | CURRENT KEYWORD |
|---|---|
| DW | currentDW |
| DWL | currentDWL |
Example: For instance, the currentItem keyword is useful when working on Sales Breakdown Lines.
If a FP matched a Sales breakdown line, and if you want to define the same existence rule for both objects - FP and SBL – you can implement a unique BRC by using the currentItem keyword.
[current]
A BRC which is attached to a looped Configuration Process, Form or Sales Breakdown Line (or to one of their attributes) will be executed contextually, meaning that it will be executed in the context of a specific instance.
That specific instance is commonly referred to as the “current” instance ; therefore the expressions CPE.currentForm[current] or CPE.currentCP[current] or CPE.currentSBL[current] or CPE…workspace/class/name[current]… can be used.
[last]
Definition:** A BRC which is attached to a looped Configuration Process, Form or Sales Breakdown Line (or to one of their attributes) can refer to the “last” instance (meaning the instance having the highest instanceNumber).
In order to reference that instance, the following expressions can be used:
CPE.currentForm[last] or CPE.currentCP[last] or CPE.currentSBL[last] or
CPE…workspace/class/name[last]…
[all]
Definition: A BRC which refer to a looped Configuration Process or Form (or to one of their attributes) can refer to “all” instances at the same time (meaning the alias associated to the CPE containing [all] is converted into an array if the refered value is a single value, a table if the refered value is a list value).
In order to reference all the instances, the following expressions can be used:
CPE.currentForm[all] or CPE.currentCP[all] or CPE…workspace/class/name[all]…
MustExist and MustBeAnswered flags defined on CPE using [all] are applied on this CPE instantiated for each instance.
Thus, aliases can refer to multiple values on several ways: a CPE that refers to a list property, a CPE that refers to a single property in a multiple instances context (looped CP or looped Form) and a CPE that refers to a list property in a multiple instances context.
These different cases are associated to the following well-formed Macro Language tables:
PROCESSED CPES
Absolute CPE are easy to use and relative CPE will allow you to reuse a BRC multiple times in a Configuration Process (or in multiple Configuration Processes). But what if you would like to create a fully defined structure including its BRC between those in multiple differently structured Configuration Processes?
This is where processed CPE come into play. Processed CPE will not directly point to an object or an attribute (like absolute CPE), and will not even point indirectly to an object or an attribute.
Processed CPE will be calculated by the engine, and the result of that calculation will be an absolute CPE.
Processed CPE allow you to make an abstraction of the exact location of the targeted object or attribute.
General Format
The general format of a processed CPE is the following:
This format needs to be read as follows:
Algorithm
The algorithm that searches the nearest target expression will conduct its search using the following order:
First the underlying structure. Then the first parent and its underlying structure (excluding the part which has already been searched).
This searching algorithm is illustrated by the following example:
Once a matching object has been found, the algorithm will replace the Processed CPE by the matching Absolute CPE.
Examples
Example 1:
Find the nearest occurrence of the value attribute of Form Property FP1 in Form FO1, starting at the current Form.
CPE.currentForm.nearest.FO/FO1.FP/FP1.value
Example 2: Find the nearest occurrence of the attribute state.exists of Form FO2, starting at the current Configuration Process.
CPE.currentCP.nearest.FO/FO2.state.exists
Example 3: Find the nearest occurrence of the value attribute of Form Property FP2 in Form FO3, starting at the second instance of the Configuration Process CPLine.
CPE.rootCP.CP/CPLine[2].nearest.FO/FO3.FP/FP2.value
CPE GET METHOD
In addition to the three types of CPE described in this chapter, the CPQ engine also allows using a method (GET) to replace parts of a CPE based on the computation of other CPEs.
- A complete CPE token between two dots replaced by a constant string
- A complete CPE token between two dots replaced by a PK
- A workspace of a PK of a CPE replaced by a constant string
- The name of a PK of a CPE replaced by a contant string
Example:For instance:
- CPE.currentFp.GET(CPE.Settings.Session.myGenericFpPropertyName) where CPE.Settings.Session.myGenericFpPropertyName returns a string
- CPE.currentForm.GET(CPE.Settings.Session.myGenericFpPk).value where CPE.Settings.Session.myGenericFpPk returns a PK
- CPE.currentForm.FP/GET(CPE.Settings.Session.myGenericFpName).value where CPE.Settings.Session.myGenericFpName returns a string
- CPE.currentCP.GET(CPE.Settings.Session.myGenericFormWorkpsace)/F0/GET (CPE.Settings.Session.myGenericFormName).name where CPE.Settings.Session.myGenericFormWorkpsace and CPE.Settings.Session.myGenericFormName return a string
Modeling CPE Expressions
CPE LENGTH
AUTOMATED CPE GENERATION
In the Designer, whenever a BRC is attached to an attribute, the corresponding CPE is immediately added to the BRC.
During CPE generation, relative CPE will be privileged, but in some cases absolute CPE will be generated. These automatically generated CPE can always be updated manually.
USING THE CPE EXPLORER
The CPE Explorer is available in the dropdown list on the left panel on screens and steps that leverages CPEs. As an example, it is used in the Manage BRC screen to assist the administrator when defining business rules Aliases. The CPE Explorer allows you to manually navigate through the CPE which are important for your current model:
Once you have found the targeted CPE, you can drag & drop it (by using the icon) to the destination cell.
USING THE CPE BUILDER
The CPE Builder will allow you to manually construct a CPE. It displays a combo box, in which you can construct your CPE bit by bit:
The combo box will automatically suggest values each time a special character is entered. These characters are “.”, “/” and “[“, and allow constructing the various pieces.
It also displays a text area, in which you can see the result of a previously constructed CPE:
