Define Constraints for Quote Groups, Ramps, and Ramp Segments

Apply rules to quote groups, ramps, and ramp segments by using the SalesTransactionItemGroup context tag. Assign a groupby value to messages defined in Constraint Rules Engine to include the messages in custom grouping strategies.

  • Define a Constraint for a Quote Group

    To define a constraint for a quote group, use the require rule to assign the SalesTransactionItemGroup attribute that’s contained on a type to the value of the QuoteGroup container.

  • Define a Constraint for a Ramp Group

    To define a constraint that applies to a ramp group, use the IsLineGroupRamped__std attribute in the require rule to specify that the group is a ramp group.

  • Define a Constraint for a Ramp Segment

    To define a rule that applies to a ramp segment for defined conditions, use the ItemSegmentType attribute.

Define a Constraint for a Quote Group 

To define a constraint for a quote group, use the require rule to assign the SalesTransactionItemGroup attribute that’s contained on a type to the value of the QuoteGroup container.

In this example for a GeneratorSet and its Enclosure, all the relations defined in the groupBy container include the SalesTransactionItemGroup attribute. Constraint Rules Engine creates a virtual container for each unique value of the SalesTransactionItemGroup attribute defined in the groupBy container. The engine creates one virtual container with its own self-contained rule execution for each group that contains one or more of the products defined in the QuoteGroup container.

Groups don’t support rules such as Hide, Disable, or Recommend, that perform an action when specified conditions are true.

Note

Example 

1type LineItem {
2    @(tagName = "SalesTransactionItemGroup")
3    string SalesTransactionItemGroup;
4}
5
6type GeneratorSet : LineItem;
7type Enclosure : LineItem;
8
9// Transaction scoped container
10@(virtual = true)
11type Quote {
12    relation quotegroup : QuoteGroup;
13    @(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation generators : GeneratorSet;
14    @(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation enclosures : Enclosure;
15}
16
17// Group scoped container
18@(virtual = true, groupBy = SalesTransactionItemGroup)
19type QuoteGroup {
20    string SalesTransactionItemGroup; // Needed for the require rule to save
21
22    @(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation generators : GeneratorSet;
23    @(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation enclosures : Enclosure;
24
25    require(generators[GeneratorSet], enclosures[Enclosure] {SalesTransactionItemGroup = SalesTransactionItemGroup});
26}

Define a Constraint for a Ramp Group 

To define a constraint that applies to a ramp group, use the IsLineGroupRamped__std attribute in the require rule to specify that the group is a ramp group.

In this example, the Enclosure is added to the group only if the GeneratorSet is in a ramp group. In the last lines of the example, the IsLineGroupRamped__std attribute in the require rule specifies that the GeneratorSet is in a ramp group.

Groups don’t support rules such as Hide, Disable, or Recommend, that perform an action when specified conditions are true.

Note

To add a type to an unramped group only and exclude the type from ramp groups, set the IsLineGroupRamped__std attribute to NOT (!) in the require rule. For example, require(!(generators[GeneratorSet].IsLineGroupRamped__std),.

Note

Example 

1type LineItem {
2    @(tagName = "SalesTransactionItemGroup")
3    string SalesTransactionItemGroup;
4    @(tagName = "IsLineGroupRamped__std")
5    boolean IsLineGroupRamped__std;
6}
7
8type GeneratorSet : LineItem;
9type Enclosure : LineItem;
10
11// Transaction scoped container
12@(virtual = true) type Quote {
13relation quotegroup : QuoteGroup;
14}
15
16// Group scoped container
17@(virtual = true, groupBy = SalesTransactionItemGroup)
18type QuoteGroup {
19    string SalesTransactionItemGroup; // Needed for the require rule to save
20
21    @(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation generators : GeneratorSet;
22    @(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation enclosures : Enclosure;
23
24    require(generators[GeneratorSet].IsLineGroupRamped__std, enclosures[Enclosure] {SalesTransactionItemGroup = SalesTransactionItemGroup});
25}

Define a Constraint for a Ramp Segment 

To define a rule that applies to a ramp segment for defined conditions, use the ItemSegmentType attribute.

In this example, Enclosure is included in the group with GeneratorSet only if ItemSegmentType for GeneratorSet isn’t Trial. To set a value for ItemSegmentType, the type must be in a ramp group and be ramped.

Groups don’t support rules such as Hide, Disable, or Recommend, that perform an action when specified conditions are true.

Note

Example 

1type LineItem {
2@(tagName = "SalesTransactionItemGroup")
3string SalesTransactionItemGroup;
4@(tagName = "ItemSegmentType")
5string ItemSegmentType;
6}
7
8type GeneratorSet : LineItem;
9type Enclosure : LineItem;
10
11// Transaction scoped container
12@(virtual = true) type Quote {
13relation quotegroup : QuoteGroup;
14}
15// Group scoped container
16@(virtual = true, groupBy = SalesTransactionItemGroup)
17type QuoteGroup {
18string SalesTransactionItemGroup; // Needed for the require rule to save
19
20@(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation generators : GeneratorSet;
21@(sourceContextNode = "SalesTransaction.SalesTransactionItem") relation enclosures : Enclosure;
22
23require(generators[GeneratorSet].ItemSegmentType != "Trial", enclosures[Enclosure] {SalesTransactionItemGroup = SalesTransactionItemGroup});
24}