Order and commerce item markers allow you to add arbitrary information to an order or commerce item and persist that information for use in your application.
Another way to accomplish that goal is by using custom properties; however, custom properties typically hold only one piece of data, requiring one custom property for each type of data you want to store. Markers allow you to store several pieces of information in one repository item, and have supporting conditions, actions, events, and servlet beans designed to create, locate, and remove markers. These features can make markers preferable to custom properties.
The marker
and commerceItemMarker
repository item types in the order repository both have the same properties, all of which are strings:
key
value
data
In addition, the repository definitions of the order
and commerceItem
item types include a markers
property to store the set
of markers.
The key
property distinguishes one kind of marker from another. You can think of the key
as a marker type, which will be used as an organizing principle for the marker data. The key
property might be a superset of the value
. Similarly, the data
property might be a subset of value
.
Here’s how markers work:
Configure a marker manager. The marker manager facilitates all interaction between markers and orders or commerce items, such as creating and removing markers.
Write code to define how and when markers will be created and attached to an order or commerce item.
Your application can check for specific markers and use scenarios or servlet beans that respond based on the markers.
For best performance, remove markers when you no longer need them.
For additional information, see the atg.markers
package in the ATG Platform API Reference.