com.elasticpath.domain.rules.impl
Class ProductAmountDiscountActionImpl
java.lang.Object
com.elasticpath.domain.impl.AbstractEpDomainImpl
com.elasticpath.domain.impl.AbstractPersistenceImpl
com.elasticpath.domain.impl.AbstractValueObjectImpl
com.elasticpath.domain.rules.impl.AbstractRuleElementImpl
com.elasticpath.domain.rules.impl.AbstractRuleActionImpl
com.elasticpath.domain.rules.impl.ProductAmountDiscountActionImpl
- All Implemented Interfaces:
- EpDomain, Persistence, RuleAction, RuleElement, ValueObject, java.io.Serializable
public class ProductAmountDiscountActionImpl
- extends AbstractRuleActionImpl
- implements RuleAction
Rule action that discounts a product by a given amount.
- See Also:
- Serialized Form
Method Summary |
boolean |
appliesInScenario(int scenarioId)
Check if this rule element is valid in the specified scenario. |
java.lang.String[] |
getAllowedExceptions()
Return the array of the allowed RuleException types for the rule. |
java.lang.String |
getDisplayText()
Return the text representation of this action for display to the user. |
java.lang.String[] |
getParameterKeys()
Return an array of parameter keys required by this rule action. |
java.lang.String |
getRuleCode()
Return the Drools code corresponding to this action. |
void |
validate()
Checks that the rule set domain model is well formed. |
Methods inherited from class com.elasticpath.domain.rules.impl.AbstractRuleElementImpl |
addParameter, getExceptions, getKind, getParameters, getType, setDefaultValues, setExceptions, setKind, setParameters, setRuleId, setType |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
public static final long serialVersionUID
- Serial version id.
- See Also:
- Constant Field Values
ProductAmountDiscountActionImpl
public ProductAmountDiscountActionImpl()
appliesInScenario
public boolean appliesInScenario(int scenarioId)
- Check if this rule element is valid in the specified scenario.
- Specified by:
appliesInScenario
in interface RuleElement
- Parameters:
scenarioId
- the Id of the scenario to check (defined in RuleScenarios)
- Returns:
- true if the rule element is applicable in the given scenario
getAllowedExceptions
public java.lang.String[] getAllowedExceptions()
- Return the array of the allowed
RuleException
types for the rule.
- Specified by:
getAllowedExceptions
in interface RuleElement
- Returns:
- an array of String of the allowed
RuleException
types for the rule.
getDisplayText
public java.lang.String getDisplayText()
- Return the text representation of this action for display to the user.
- Specified by:
getDisplayText
in interface RuleElement
- Returns:
- the text representation
getParameterKeys
public java.lang.String[] getParameterKeys()
- Return an array of parameter keys required by this rule action.
- Specified by:
getParameterKeys
in interface RuleElement
- Returns:
- the parameter key array
getRuleCode
public java.lang.String getRuleCode()
throws EpDomainException
- Return the Drools code corresponding to this action.
- Specified by:
getRuleCode
in interface RuleElement
- Returns:
- the Drools code
- Throws:
EpDomainException
- if the rule is not well formed
validate
public void validate()
- Checks that the rule set domain model is well formed. For example, rule conditions must have all required parameters specified.
- Specified by:
validate
in interface RuleElement
- Overrides:
validate
in class AbstractRuleElementImpl
- Throws:
EpDomainException
- if the structure is not correct.