public class MerchandiseTotalCondition
extends atg.process.filter.ExpressionFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string.
|
static int |
EQUAL_TO
Equal constant.
|
static int |
GREATER_THAN
Greater than constant.
|
static int |
LESS_THAN
Less than constant.
|
static java.lang.String |
MESSAGE_ORDER_PROPERTY
The property of the message that points to the order.
|
Constructor and Description |
---|
MerchandiseTotalCondition() |
Modifier and Type | Method and Description |
---|---|
void |
configure(java.lang.String pOperator,
java.lang.Object pConfiguration)
Configures this ExpressionFilter using the given configuration
object.
|
protected atg.process.filter.Filter |
evaluate(atg.process.ProcessExecutionContext pContext)
This filter takes the amount entered by the business user an
the pmdl rule.
|
protected boolean |
evaluatePMDLRule(atg.process.ProcessExecutionContext pContext,
atg.commerce.order.Order pOrder,
atg.commerce.order.CommerceItem pItem)
Evaluate the rule put before us for the commerce item in question.
|
void |
initialize(java.lang.String pOperator,
atg.process.expression.Expression[] pOperands)
Initializes this ExpressionFilter, given its operator and
operands.
|
equals, getOperands, getOperator, operandsEquals, setOperands, setOperator, toString
public static final java.lang.String CLASS_VERSION
public static final int LESS_THAN
public static final int EQUAL_TO
public static final int GREATER_THAN
public static final java.lang.String MESSAGE_ORDER_PROPERTY
public void configure(java.lang.String pOperator, java.lang.Object pConfiguration) throws atg.process.ProcessException
configure
in class atg.process.filter.ExpressionFilter
pOperator
- - operatorpConfiguration
- - configurationatg.process.ProcessException
- if the filter could not be configured
- for example, because some of the required properties are
missing from the configurationpublic void initialize(java.lang.String pOperator, atg.process.expression.Expression[] pOperands) throws atg.process.ProcessException
This implementation, in addition, verifies that there is exactly one operand, and that its value is a constant. The constant value of the operand is the PMDL string that defines this filter.
initialize
in class atg.process.filter.ExpressionFilter
pOperator
- - operatorpOperands
- - operandsatg.process.ProcessException
- if the operands argument is invalidprotected atg.process.filter.Filter evaluate(atg.process.ProcessExecutionContext pContext) throws atg.process.ProcessException
This filter takes the amount entered by the business user an the pmdl rule. It then finds all the commerce items in the order that match the given pmdl rule. Of those that match this filter totals up their ItemPriceInfo.amount fields and applies the logic supplied by the business user to determine if the total amount of all the items matches the price criteria.
Evaluates this filter in the given scenario execution context. The context may not yet contain all of the information necessary to evaluate the filter - specifically, it may be missing the particular scenario instance and/or profile that the scenario is being executed on. If that is the case, the filter is evaluated as much as possible, and the simplified filter is returned.
The possible return values of this method are as follows:
Filter.TRUE
- if the filter can be fully
evaluated, and is satisfied in the given context
Filter.FALSE
- if the filter can be fully
evaluated, and is not satisfied in the given context
this
or another, simplified, Filter
- if the filter cannot be fully evaluated because of the missing
information in the context
null
- if the filter cannot be evaluated because
of a null expression encountered during evaluation (e.g., filter
refers to a profile property which evaluates to null)
evaluate
in class atg.process.filter.Filter
pContext
- - process execution contextatg.process.ProcessException
- if there is a problem evaluating the
filter (other than information missing from the context)protected boolean evaluatePMDLRule(atg.process.ProcessExecutionContext pContext, atg.commerce.order.Order pOrder, atg.commerce.order.CommerceItem pItem) throws atg.process.ProcessException
pContext
- - process execution contextpOrder
- - orderpItem
- - the commerce item to evaluate the rule foratg.process.ProcessException
- if process error occurs