The Price Model Definition Language (PMDL) describes Oracle Commerce Cloud promotions internally.
PMDL describes the rules for when a promotion may apply (the condition), the rules for what may be discounted (the offer), and how to apply the discount (for example, 10% off).
This section describes the XML used for constructing discount rules that represent promotions in Oracle Commerce Cloud.
PMDL XML structure
The PMDL that describes promotions discount rules is relatively simple. The DTD defines the following to use in your PMDL rules:
- Iterators such as
- Quantifiers that are used in
WHENconditions, such as
- Operators such as
- Comparators such as
less-than and equals, which compare values and/or arrays.
- Operations such as
- Value types such as
- Array types such as
The PMDL DTD contains the following elements:
pricing-model element is the root tag for the PMDL.
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
filter-collection-name attribute of the
this ensures that once a given item has been marked to receive a discount, it cannot receive a
discount from any other
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
collection-name attribute, which is normally set to
Filtering is not required for single discount structures, or for non-item-based promotions.
pricing-model requires one
qualifier is the root tag for the promotion’s
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
discount-structure element has the following attributes:
calculator-type: A calculator service configured in the pricing engine. For all Oracle Commerce Cloud promotions, the value for
discount-type: The calculators use this value to determine how to calculate an adjustment. Valid values are:
adjuster: This optional attribute specifies the price adjustment to make for this discount. For example, the following discount structure element specifies that the promotion should discount the target by 50%:
<discount-structure calculator-type="standard" discount-type="percentOff" adjuster="50"></discount-structure>
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 sorts a collection of items, then evaluate each item
against one or more sub-expressions. It returns those items that match the sub-expressions.
iterator element allows you to create custom iterators. Your new
iterator element must include a
name attribute that is unique
across the PMDL.
iterator element can have the following attributes and
Quantifiers are evaluation beans that evaluate a collection of items against one or
more sub-expressions. It returns
false, depending on
the quantity of items that match the sub-expressions.
quantifier element allows you to create custom quantifiers. Your
quantifier element must include a name attribute that is unique across the
quantifier element can have the following attributes and
false based on the
Boolean results from their sub-expressions.
operator element allows you to create custom operators. Your
operator element must include a name attribute that is unique across the
operator element can specify any number of attribute
sub-elements and operates on at least one comparator, operator or quantifier.
false depending on the
values of their sub-expressions.
comparator element allows you to create custom comparators.
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:
Comparators can also compare two value elements, and custom comparators could
include any number of
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:
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>