|
|||||||||
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 Rule
ruleAction
- the action to add.
EpDomainException
- if anything goes wrong.public void addCondition(RuleCondition condition)
addCondition
in interface Rule
condition
- the condition to add
EpDomainException
- if anything goes wrong.public void addEligibility(RuleEligibility eligibility)
addEligibility
in interface Rule
eligibility
- the RuleEligibility
to add
EpDomainException
- if anything goes wrong.public java.util.Set getActions()
getActions
in interface Rule
public boolean getConditionOperator()
getConditionOperator
in interface Rule
public java.util.Set getConditions()
getConditions
in interface Rule
public java.util.Set getEligibilities()
getEligibilities
in interface Rule
public boolean getEligibilityOperator()
getEligibilityOperator
in interface Rule
public java.util.Date getEndDate()
getEndDate
in interface Rule
public java.lang.String getName()
getName
in interface Rule
public abstract java.lang.String getRuleCode()
getRuleCode
in interface Rule
public RuleSet getRuleSet()
getRuleSet
in interface Rule
public java.util.Date getStartDate()
getStartDate
in interface Rule
public void setActions(java.util.Set actions)
setActions
in interface Rule
actions
- a set of RuleAction
objectspublic void setConditionOperator(boolean conditionOperator)
setConditionOperator
in interface Rule
conditionOperator
- - the condition operator (ANR/OR).public void setConditions(java.util.Set conditions)
setConditions
in interface Rule
conditions
- a set of RuleCondition
objectspublic void setDefaultValues()
setDefaultValues
in interface Persistence
setDefaultValues
in class AbstractEntityImpl
public void setEligibilities(java.util.Set eligibilities)
setEligibilities
in interface Rule
eligibilities
- a set of RuleCondition
objectspublic void setEligibilityOperator(boolean eligibilityOperator)
setEligibilityOperator
in interface Rule
eligibilityOperator
- - the eligibility condition operator (ANR/OR).public void setEndDate(java.util.Date endDate)
setEndDate
in interface Rule
endDate
- the end datepublic void setName(java.lang.String name)
setName
in interface Rule
name
- the name of the rulepublic void setRuleSet(RuleSet ruleSet)
setRuleSet
in interface Rule
ruleSet
- the ruleSet it belongs to.public void setStartDate(java.util.Date startDate)
setStartDate
in interface Rule
startDate
- the start datepublic void validate() throws EpDomainException
validate
in interface Rule
EpDomainException
- if the structure is not correct.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |