Product Administration Guide > Configuration Rule Template Reference >

Relationship Item Constraint

The Relationship Item Constraint template has the form:

For each item [in a relationship], constrain [an expression] to be true

The "in a relationship" operand can be a whole relationship, a subclass of items in a relationship, or a product in a relationship. The "an expression" operand can be any rule template or any rule you construct from templates.

The purpose of the Relationship Item Constraint template is to allow you to write a rule for items in a relationship as if you had written the rule separately for each instance of the items. For example, you define Relationship A that contains the customizable product desktop PC. The desktop PC is a customizable product that includes two relationships: CPU and Hard Drive. You then write the following rule:

For each item in Relationship A, constrain CPU requires Hard Drive to be true

This rule enforces "CPU requires Hard Drive" separately on each instance of desktop PC in Relationship A. All the desktop PCs from Relationship A must have a hard drive if they have a CPU.

A require rule does not do this. Suppose you had written the following rule:

CPU requires Hard Drive

This rule means if any desktop PC has a CPU from the CPU relationship then at least one desktop PC must have a hard drive from the Hard Drive relationship.

This means, for example, that if the user configures three desktop PCs, all with CPUs, then only one of them must have a hard drive. If the user removes the hard drive, the eConfigurator engine would add a hard drive to another desktop PC in the solution or add a new desktop PC that contains only a hard drive. The require rule defines a constraint that is true about the group of desktop PCs in the solution rather than about individual desktop PCs.

Another problem with the require rule is that it does not limit enforcement of the constraint to the items in Relationship A. If, in the require rule example, desktop PCs were also contained in Relationship B, then desktop PCs configured from Relationship B would also be considered when enforcing the require rule for desktop PCs configured from Relationship A.

An important use of this template is to write rules that apply to customizable products only when these products are contained in a relationship within another customizable product.

Product Administration Guide