atg.commerce.markers.scenario
Class OrderHasMarker

java.lang.Object
  extended by atg.process.filter.Filter
      extended by atg.process.filter.ExpressionFilter
          extended by atg.markers.scenario.MarkerExpressionFilter
              extended by atg.commerce.markers.scenario.OrderHasMarker
All Implemented Interfaces:
OrderMarkerConstants, MarkerConstants

public class OrderHasMarker
extends MarkerExpressionFilter
implements OrderMarkerConstants

This class can be used to create marker test expressions for an order.

Extensions must provide the map of the new expression's operator names to the ones provided by this class.

The operator names provided by this class are:
hasMarker
hasLastMarker
hasLastMarkerWithKey

See Also:
MarkerConfiguration.getHasMarkerOperatorMap()

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String OP_HAS_LASTMARKER
           
static java.lang.String OP_HAS_LASTMARKER_WITHKEY
           
static java.lang.String OP_HAS_MARKER
          Scenario operators handled by the evaluate methods
 
Fields inherited from class atg.markers.scenario.MarkerExpressionFilter
mMarkerConfiguration
 
Fields inherited from class atg.process.filter.Filter
FALSE, TRUE
 
Fields inherited from interface atg.commerce.markers.OrderMarkerConstants
ORDER_MARKER_RESOURCE_NAME, ORDER_PROPERTY_NAME, sResourceBundle
 
Fields inherited from interface atg.markers.MarkerConstants
ALLOW_DUPLICATES, ANY_VALUE, DEFAULT_MARKER_ID_PROPERTY_NAME, DEFAULT_MARKER_ITEM_TYPE, DEFAULT_MARKER_PROPERTY_NAME, DEFAULT_MARKER_SORT_PROPERTY_NAME, MARKER_CREATIONDATE_PROPERTY_NAME, MARKER_DATA_PROPERTY_NAME, MARKER_DUPLICATIONMODE_PROPERTY_NAME, MARKER_KEY_PROPERTY_NAME, MARKER_OWNER_PROPERTY_NAME, MARKER_RESOURCE_NAME, MARKER_VALUE_PROPERTY_NAME, NO_DUPLICATES, PARAM_DATA, PARAM_DUPMODE, PARAM_EXTENDED_PROPERTIES, PARAM_ITEM, PARAM_ITEM_ID, PARAM_KEY, PARAM_MARKED_ITEM_TYPE, PARAM_MARKER_ITEM_TYPE, PARAM_MARKER_MANAGER, PARAM_MARKER_PROPERTY_NAME, PARAM_VALUE, REPLACE_DUPLICATES, sResourceBundle
 
Constructor Summary
OrderHasMarker()
           
 
Method Summary
protected  Filter evaluate(ProcessExecutionContext pContext)
          Evaluates this filter in the given process execution context.
protected  java.lang.String getHasMarkerOperatorToPerform(ProcessExecutionContext pContext)
          This method is called by the evaluate method to determine the operator name.
protected  Order getOrderToUse(ProcessExecutionContext pContext)
          This method is called by the doAction method to return the Order that's used in the order marker manager API calls.
 void initialize(java.lang.String pOperator, Expression[] pOperands)
          called by Scenario Manager to initialize the expression
 
Methods inherited from class atg.markers.scenario.MarkerExpressionFilter
configure, getData, getDuplicationMode, getExtendedProperties, getKey, getMarkedItemType, getMarkerConfiguration, getMarkerItemType, getMarkerPropertyName, getRepositoryMarkerManager, getValue, setMarkerConfiguration
 
Methods inherited from class atg.process.filter.ExpressionFilter
equals, getOperands, getOperator, operandsEquals, setOperands, setOperator, toString
 
Methods inherited from class atg.process.filter.Filter
andFilters, andFilters, assumeFalse, assumeTrue, createProcessInstanceQuery, createSubjectQuery, getResourceBundle, getSubjectType, hashCode, implies, isCacheable, negate, orFilters, orFilters, setCacheable, test
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


OP_HAS_MARKER

public static final java.lang.String OP_HAS_MARKER
Scenario operators handled by the evaluate methods

See Also:
Constant Field Values

OP_HAS_LASTMARKER

public static final java.lang.String OP_HAS_LASTMARKER
See Also:
Constant Field Values

OP_HAS_LASTMARKER_WITHKEY

public static final java.lang.String OP_HAS_LASTMARKER_WITHKEY
See Also:
Constant Field Values
Constructor Detail

OrderHasMarker

public OrderHasMarker()
Method Detail

getOrderToUse

protected Order getOrderToUse(ProcessExecutionContext pContext)
This method is called by the doAction method to return the Order that's used in the order marker manager API calls.

The order is either extracted from the event or from the current session's shopping cart.


getHasMarkerOperatorToPerform

protected java.lang.String getHasMarkerOperatorToPerform(ProcessExecutionContext pContext)
This method is called by the evaluate method to determine the operator name.

By default, this method uses the operator name returned by getOperator to lookup to the appropriate base operator name provided by ItemHasMarker.

The base operator names for OrderHasMarker are: hasMarker, hasLastMarker and hasLastMarkerWithKey

Because this class can be extended to implement any number of scenario hasMarker expressions, the new expression operator names must be mapped in the configuration component to one of the standard operators above.

Returns:
String the operator name
See Also:
MarkerConfiguration.getHasMarkerOperatorMap()

initialize

public void initialize(java.lang.String pOperator,
                       Expression[] pOperands)
                throws ProcessException
called by Scenario Manager to initialize the expression

Overrides:
initialize in class MarkerExpressionFilter
Parameters:
pOperator - the filter operator names
pOperands - the operands to the filter.
Throws:
ProcessException - if the operands argument is invalid

evaluate

protected Filter evaluate(ProcessExecutionContext pContext)
                   throws ProcessException
Evaluates this filter in the given process execution context.

The possible return values of this method are as follows:

Specified by:
evaluate in class Filter
Throws:
ProcessException - if there is a problem evaluating the filter (other than information missing from the context)