|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.process.filter.Filter atg.process.filter.ExpressionFilter atg.projects.store.scenario.MerchandiseTotalCondition
public class MerchandiseTotalCondition
This expression filter (Scenario Condition) allows us to write scenarios that say "Order contains [less than] [$24.00] merchandise where items [in category ] [x]. This is specifically to handle the case where a merchant wishes to give a free gift when a user purchases at least $24.50 of items from a specific category.
Field Summary | |
---|---|
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. |
Fields inherited from class atg.process.filter.Filter |
---|
FALSE, TRUE |
Constructor Summary | |
---|---|
MerchandiseTotalCondition()
|
Method Summary | |
---|---|
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. |
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 |
---|
public static 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
Constructor Detail |
---|
public MerchandiseTotalCondition()
Method Detail |
---|
public void configure(java.lang.String pOperator, java.lang.Object pConfiguration) throws atg.process.ProcessException
configure
in class atg.process.filter.ExpressionFilter
pOperator
- - operatorpConfiguration
- - configuration
atg.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
- - operands
atg.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 context
atg.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 for
atg.process.ProcessException
- if process error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |