Get Started with Revenue Management Developer Resources
Revenue Management Settings
Modeling a Generator Set
Core Concept Examples
Model Structure
Previous Versions
Constraint Modeling Language (CML) is a domain-specific language that defines models for complex systems. For product configuration, constraint models describe real-world entities and their relationships to each other.
Constraint models enforce business logic declaratively, without the need for extensive code in a general-purpose programming language. In Product Configurator, a product designers or admin create a constraint model in CML, then Constraint Rules Engine compiles the CML code. The constraint model enforces requirements in a product configuration to comply with the specified constraints.
When you enable Constraint Rules Engine in Product Configurator, any rules you created using Business Rules Engine no longer execute. But, you can export rules from Business Rules Engine and convert them to CML code. For more information, see Define Rules Engine with Transaction Processing Types and Convert Rules from Business Rules Engine into CML Code.
Note
To build a constraint model in CML, use this basic workflow.
In Product Configurator, use the Visual Builder and CML Editor in Constraint Builder to create constraint models with CML.
See the linked topics for information on working with CML, including detailed code examples.
The Constraint Model for a Generator Set examples use CML to define a technical power configuration, illustrating concepts such as calculated variables, enforcement of external standards, and component selection based on requirements.
Constraint Modeling Language (CML) includes components that cover high-level global configurations to specific data types and constraints.
These examples illustrate core Constraint Modeling Language (CML) concepts including type, relationships, constraints, and so on.
Constraint Modeling Language (CML) annotations are labels that you add to parts of a model, such as types, variables, relationships, and constraints. Annotations control how these elements are shown and how they behave in the configurator. Annotations help fine-tune the configurator and the constraint engine without changing the actual structure of the model.
Constraint Modeling Language (CML) Best Practices
To prevent performance degradation or unexpected behaviors when the constraint engine executes CML code, follow these practices when writing code.
Business-Centric Constraint Modeling Language (CML) Guidelines
Constraint Modeling Language (CML) must accurately calculate the total sum or aggregate of specific attributes like quantity or userCount across child components, especially in complex configurations requiring group-level aggregation
Debugging Constraint Modeling Language (CML)
For optimal performance with CML, follow the performance guidelines and use debug logging to debug constraint models.
The tables on the following pages show the structure for the constraint model in Core Concept Examples.