The PMDL that describes promotions discount rules is relatively simple. The DTD defines the following to use in your PMDL rules:

The PMDL DTD contains the following elements:

Pricing-Model element

The pricing-model element is the root tag for the PMDL.

Offer element

Every pricing-model requires one offer element. The offer includes one or more discount-structure elements, which contain detailed information about the discount and its target.

You can include more than one discount-structure element in an offer; this allows you to wrap multiple discounts in a single promotion (note that this is not supported in Merchandising, but you can build a custom template with this functionality).

If you have multiple discount structures within a single item promotion, you can specify the filter-collection-name attribute of the offer; this ensures that once a given item has been marked to receive a discount, it cannot receive a discount from any other discount-structures. If filter-collection-name is not set, filtering does not take place, and a given commerce item can be the target for more than one discount. The filter-collection-name should match the iterator element’s collection-name attribute, which is normally set to items. Filtering is not required for single discount structures, or for non-item-based promotions.

Qualifier Element

Every pricing-model requires one qualifier element. The qualifier is the root tag for the promotion’s buy condition.

Target Element

The target specifies the rule for selecting the items to be discounted. Your discount structure should not include a target element if the promotion is for orders or shipping; only item discounts include target as part of the discount-structure.

Discount-Structure element

The discount-structure element has the following attributes:

Attribute element

The attribute element allows you to add generic name/value pairs to parent tags, similar to the process used to extend a Core Commerce repository. During PMDL parsing, the attributes and their values are placed in an attribute Map.

Iterator element

An iterator sorts a collection of items, then evaluate each item against one or more sub-expressions. It returns those items that match the sub-expressions.

The iterator element allows you to create custom iterators. Your new iterator element must include a name attribute that is unique across the PMDL.

An iterator element can have the following attributes and sub-elements:

Quantifier element

Quantifiers are evaluation beans that evaluate a collection of items against one or more sub-expressions. It returns true or false, depending on the quantity of items that match the sub-expressions.

The quantifier element allows you to create custom quantifiers. Your new quantifier element must include a name attribute that is unique across the PMDL.

A quantifier element can have the following attributes and sub-elements:

Operator element

Operators return true or false based on the Boolean results from their sub-expressions.

The operator element allows you to create custom operators. Your new operator element must include a name attribute that is unique across the PMDL.

An operator element can specify any number of attribute sub-elements and operates on at least one comparator, operator or quantifier.

Comparator element

Comparators return true or false depending on the values of their sub-expressions.

The comparator element allows you to create custom comparators. Your new comparator element must include a name attribute that is unique across the PMDL. A comparator element can specify any number of attribute sub-elements and must specify at least one value or array name.

Comparators evaluate using one or more sub-expressions. For example:

<comparator name="includes-any">

Comparators can also compare two value elements, and custom comparators could include any number of value or constant elements.

Value element

The value element returns the value of a property of the item the promotion is evaluating. You must include the value element for Buy One Get One promotions as follows:

<value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
Constant element

The constant element returns a constant value against which other values can be compared. For example:

<constant>
  <data-type>java.lang.String</data-type>
  <string-value>xprod2147</string-value>
</constant>

Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices