|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.elasticpath.domain.impl.AbstractEpDomainImpl
com.elasticpath.domain.impl.AbstractPersistenceImpl
com.elasticpath.domain.impl.AbstractEntityImpl
com.elasticpath.domain.rules.impl.AbstractRuleImpl
public abstract class AbstractRuleImpl
Represents a rule that can be applied by the rules engine. For example, promotion rules that execute the following may be implemented by subclasses: "Give a 10% discount for all products in category X."
| Field Summary | |
|---|---|
static long |
serialVersionUID
Serial version id. |
| Fields inherited from interface com.elasticpath.domain.rules.Rule |
|---|
AND_OPERATOR, OR_OPERATOR |
| Constructor Summary | |
|---|---|
AbstractRuleImpl()
|
|
| Method Summary | |
|---|---|
void |
addAction(RuleAction ruleAction)
Add an action to the rule. |
void |
addCondition(RuleCondition condition)
Adds a condition to the set of conditions. |
void |
addEligibility(RuleEligibility eligibility)
Adds a rule eligiblity to the set of eligibilities. |
java.util.Set |
getActions()
Get the actions associated with this rule. |
boolean |
getConditionOperator()
Gets the operator (AND/OR) if there are multiple conditions. |
java.util.Set |
getConditions()
Get the conditons associated with this rule. |
java.util.Set |
getEligibilities()
Get the eligibility conditions associated with this rule. |
boolean |
getEligibilityOperator()
Gets the operator (AND/OR) if there are multiple eligibility conditions. |
java.util.Date |
getEndDate()
Get the end date. |
java.lang.String |
getName()
Get the name of this rule. |
abstract java.lang.String |
getRuleCode()
Returns the Drools code corresponding to this rule. |
RuleSet |
getRuleSet()
Get the ruleSet this rule belongs to. |
java.util.Date |
getStartDate()
Get the starting date that this rule can be applied. |
void |
setActions(java.util.Set actions)
Set the actions of this rule. |
void |
setConditionOperator(boolean conditionOperator)
Sets the operator (AND/OR) if there are multiple eligibility conditions. |
void |
setConditions(java.util.Set conditions)
Set the conditions of this rule. |
void |
setDefaultValues()
Set default values for those fields need default values. |
void |
setEligibilities(java.util.Set eligibilities)
Set the eligibility conditions of this rule. |
void |
setEligibilityOperator(boolean eligibilityOperator)
Sets the operator (AND/OR) if there are multiple eligibility conditions. |
void |
setEndDate(java.util.Date endDate)
Set the end date. |
void |
setName(java.lang.String name)
Set the name of the rule. |
void |
setRuleSet(RuleSet ruleSet)
Set the ruleSet this rule belongs to. |
void |
setStartDate(java.util.Date startDate)
Set the starting date that this rule can be applied. |
void |
validate()
Checks that the rule set domain model is well formed. |
| Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl |
|---|
convertAttributeGroupAttributes, getGuid, setGuid |
| Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl |
|---|
executeBeforePersistAction, getUidPk, isPersistent, setUidPk |
| Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl |
|---|
getElasticPath, setElasticPath |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.elasticpath.domain.rules.Rule |
|---|
getPromoCode, isSingleUse, setPromoCode, setSingleUse |
| Methods inherited from interface com.elasticpath.domain.Entity |
|---|
getGuid, setGuid |
| Methods inherited from interface com.elasticpath.domain.Persistence |
|---|
executeBeforePersistAction, getUidPk, isPersistent, setUidPk |
| Methods inherited from interface com.elasticpath.domain.EpDomain |
|---|
getElasticPath, setElasticPath |
| Field Detail |
|---|
public static final long serialVersionUID
| Constructor Detail |
|---|
public AbstractRuleImpl()
| Method Detail |
|---|
public void addAction(RuleAction ruleAction)
addAction in interface RuleruleAction - the action to add.
EpDomainException - if anything goes wrong.public void addCondition(RuleCondition condition)
addCondition in interface Rulecondition - the condition to add
EpDomainException - if anything goes wrong.public void addEligibility(RuleEligibility eligibility)
addEligibility in interface Ruleeligibility - the RuleEligibility to add
EpDomainException - if anything goes wrong.public java.util.Set getActions()
getActions in interface Rulepublic boolean getConditionOperator()
getConditionOperator in interface Rulepublic java.util.Set getConditions()
getConditions in interface Rulepublic java.util.Set getEligibilities()
getEligibilities in interface Rulepublic boolean getEligibilityOperator()
getEligibilityOperator in interface Rulepublic java.util.Date getEndDate()
getEndDate in interface Rulepublic java.lang.String getName()
getName in interface Rulepublic abstract java.lang.String getRuleCode()
getRuleCode in interface Rulepublic RuleSet getRuleSet()
getRuleSet in interface Rulepublic java.util.Date getStartDate()
getStartDate in interface Rulepublic void setActions(java.util.Set actions)
setActions in interface Ruleactions - a set of RuleAction objectspublic void setConditionOperator(boolean conditionOperator)
setConditionOperator in interface RuleconditionOperator - - the condition operator (ANR/OR).public void setConditions(java.util.Set conditions)
setConditions in interface Ruleconditions - a set of RuleCondition objectspublic void setDefaultValues()
setDefaultValues in interface PersistencesetDefaultValues in class AbstractEntityImplpublic void setEligibilities(java.util.Set eligibilities)
setEligibilities in interface Ruleeligibilities - a set of RuleCondition objectspublic void setEligibilityOperator(boolean eligibilityOperator)
setEligibilityOperator in interface RuleeligibilityOperator - - the eligibility condition operator (ANR/OR).public void setEndDate(java.util.Date endDate)
setEndDate in interface RuleendDate - the end datepublic void setName(java.lang.String name)
setName in interface Rulename - the name of the rulepublic void setRuleSet(RuleSet ruleSet)
setRuleSet in interface RuleruleSet - the ruleSet it belongs to.public void setStartDate(java.util.Date startDate)
setStartDate in interface RulestartDate - the start date
public void validate()
throws EpDomainException
validate in interface RuleEpDomainException - if the structure is not correct.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||