Implicitly Applying Business Rules & Constraints
Understanding modeling patterns
When using CPQ Designer for multiple projects, designers find themselves optimizing the model design in order to reuse whatever they have done in the past as much as possible. A certain number of techniques have already been explained throughout this document:
- Privileging relative CPE over absolute CPE
- Combining BRC execution
- Embedding complete Configuration Processes or Forms inside other Configuration Processes
In some circumstances, designers would just like to apply the same modeling pattern to several projects, or to several locations in one project. This modeling pattern is called a template and is used to implicitly associate several BRC with an object in a Configuration Process.
Definition:
A Template is a modeling object that represents a set of Business Rules & Constraints. It is used to implicitly apply a group of BRC to a Configuration Process or a Form.
An implicit BRC is a BRC that is part of a template, and which is therefore only indirectly attached to a Configuration Process, Form, or an attribute.
Using implicit BRC
UNDERSTANDING TEMPLATE ASSOCIATION
Templates can be associated to multiple objects.
Information:
Templates can be attached to
- Configuration Processes
- Forms
UNDERSTANDING BRC ATTACHMENT
Previously, it has already been explained that BRC can be attached to Configuration Processes, to Forms, or to specific attributes, as illustrated in the following figure:
In this figure, it is clear that:
- The Configuration Process cpNode1 has a BRC BRC_cpNode1 attached to it
- BRC_cpNode2Att is a BRC controlling, for instance, the existence of Configuration Process cpNode2 inside Configuration Process cpNode1
- BRC_Form1Att is a BRC controlling, for instance, the existence of Form Form1 inside Configuration Process cpNode1
- The Form Form3 has a BRC BRC_Form3 attached to it
- The Form Property 3 inside Form3 has a BRC BRC_Fp3Att attached to it, controlling for instance its default value
When associating templates to Configuration Processes or to Forms, each individual BRC will have its own “point of attachment”.
Information:
The point of attachment of an implicit BRC is a CPE which addresses the modeling object or attribute to which the BRC should be attached.
- The point of attachment starts with CPE.currentCP (for Configuration Processes) or CPE.currentForm (for Forms)
- In the case of a point of attachment starting with CPE.currentCP, only the first sublevel can be addressed
- Example: CPE.currentCP.CP/cpNode.state.exist can be addressed but not CPE.currentCP.CP/cpNode.FO/foX.state.exist
This “point of attachment” has been illustrated in the following figure:
The template tpl1 is associated to Configuration Process cpNode1 and holds the following BRC:
- BRC_cpNode, a BRC that will be attached to CPE.currentCP, meaning cpNode1
- BRC_cpNodeAtt, a BRC that will be attached to CPE.currentCP.CP/cpNode2.state.exist, controlling its existence
- BRC_FormAtt, a BRC that will be attached to CPE.currentCP.FO/Form1.state.exist, controlling its existence
The template tpl2 is associated to Form2 as well as Form 3 and holds the following BRC:
- BRC_Form, attached to CPE.currentForm, will constrain the behavior of both forms
- BRC_FpAtt, attached to CPE.currentForm.FP/fp3.value.default, will define the domain for Form Property 3 in both forms.
Information:
Whenever an object (Configuration Process or Form) references a template, Configurator will apply every implicit BRC on the template unless another explicit BRC, immediately associated to an attribute, overrides it.
When Configurator applies the implicit BRC on every point of attachment, the completed model will look as follows:
At this point in time, the application of implicit BRC (the BRC positioned by the template on the various “points of attachment”) will depend on the type and location of the BRC, the type of output of the BRC, and the presence or absence of an explicit (as in: not originating from a template) BRC:
- Location of BRC: if the BRC are located on a Configuration Process or a Form, then they will be applied, regardless of the fact that they are implicit or explicit.
- In the figure displayed above, the following BRC will be applied: BRC_cpNode1, (tpl1) BRC_cpNode, BRC_Form3, (tpl2) BRC_Form applied on Form2 and (tpl2) BRC_Form applied on Form3.
- Absence of explicit BRC: if, for an implicit BRC attached to an attribute of an object, there is no corresponding explicit BRC, the implicit BRC will be applied.
- In the figure displayed above, the BRC (tpl2) BRC_Form applied on Form2 and (tpl2) BRC_FpAtt applied on Form Property 3 inside Form2 will be applied.
- Presence of both implicit and explicit conflicting BRC: if, for an implicit BRC attached to an attribute of an object, there is a corresponding explicit BRC having a conflicting output alias, the explicit BRC will be applied and the implicit BRC will be abandoned.
- Presence of both implicit and explicit combined BRC: if both an explicit BRC and an explicit BRC are attached to the same object attribute, and if either one of those BRC uses an “empty”
output of the other one, both BRC will be combined.
How to model implicit BRC
In order to create a template associated to a Configuration Process or Form, proceed as follows:
How-To:
- [In Structure]
- Open the explorer Explore Structure
- Open the Configuration Process or Form by clicking on it
- [In the step details]
- Click inside the “template” section
- A dialog “Add a template” will be shown
- [In the dialog window]
- Enter a template name & description.
- Hit “OK”
- The template now appears inside the “template” section
- [In the menu toolbar]
- Save
In order to associate an existing template to a Configuration Process or Form, proceed as follows:
How-To:
- [In Structure]
- Open the explorer Explore Structure
- Open the Configuration Process or Form by clicking on it
- [In Structure]
- Open the explorer Filter Objects
- Choose the workspace to which the template belongs
- Choose the type “Template”
- Optionally, enter a name and/or description matching the template’s
- [In the menu toolbar]
- Execute the search function.
- [In Filter Objects]
- Drag & drop the found template to the "template" section in the step details.
- The template now appears inside the "template" section
- [In the menu toolbar]
- Save
In order to open a template in order to manage its BRC, proceed as follows:
How-To:
- [In Structure]
- Open the explorer Explore Structure
- Open the Configuration Process or Form by clicking on it
- [In the step details]
- Click on the “template” section.
- A dialog window appears
- [In the dialog window]
- Choose “open template”
- Hit OK
- The template is opened inside the step “BRC Dictionary”
- [In the menu toolbar]
- Save
Alternatively, you can proceed as follows:
How-To:
- [In BRC Dictionary]
- Open the explorer Explore Templates
- [In Explore Templates]
- Browse through the Configuration Process structure.
- Click on the Configuration Process or Form of interest
- The associated template is shown in the lower part of the explorer
- [In Explore Templates]
- Click on the found template.
- The template is opened inside the step “BRC Dictionary”
- [In the menu toolbar]
- Save
In order to add new BRC to the template, proceed as follows:
How-To:
- [In the template content grid]
- Click inside the BRC Name cell
- A dialog window appears
- [In the dialog window]
- Provide a name, description and a content type for the BRC.
- Hit “OK”.
- The BRC is created and cell is updated.
- [In the menu toolbar]
- Save
In order to add an existing BRC to the template, proceed as follows:
How-To:
- [In BRC Dictionary]
- Open the explorer Search BRC
- [In Search BRC]
- Provide any necessary information in order to look up the BRC.
- [In the menu toolbar]
- Execute the Search function.
- The corresponding BRC are shown in the lower part of the explorer
- [In Search BRC]
- Drag & drop the BRC to the BRC Name cell in the template content grid.
- [In the menu toolbar]
- Save
In order to provide an attachment CPE, proceed as follows:
How-To:
- [In the template content grid]
- Click in the attachment CPE cell.
- Use the CPE Builder to navigate to the point of attachment.
- [In the menu toolbar]
- Save
Alternatively, in order to provide an attachment CPE, proceed as follows:
How-To:
- [In BRC Dictionary]
- Click on the “Explore CPEs” explorer.
- Use the CPE Explorer in order to navigate to the point of attachment.
- Drag and drop the found CPE to the attachment CPE cell in the template content grid.
- [In the menu toolbar]
- Save
