|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Rule
Represents a rule that can be applied by the rules engine. For example, "Give a 10% discount for all products in category X."
Field Summary | |
---|---|
static boolean |
AND_OPERATOR
"AND" operator. |
static boolean |
OR_OPERATOR
"OR" operator. |
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 conditions 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. |
java.lang.String |
getPromoCode()
Get the promoCode of this rule. |
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. |
boolean |
isSingleUse()
True if this promoCode is only for single use. |
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 |
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 |
setPromoCode(java.lang.String promoCode)
Set the promoCode of the rule. |
void |
setRuleSet(RuleSet ruleSet)
Set the ruleSet this rule belongs to. |
void |
setSingleUse(boolean singleUse)
Sets whether this promoCode is for single use. |
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 interface com.elasticpath.domain.Entity |
---|
getGuid, setGuid |
Methods inherited from interface com.elasticpath.domain.Persistence |
---|
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk |
Methods inherited from interface com.elasticpath.domain.EpDomain |
---|
getElasticPath, setElasticPath |
Field Detail |
---|
static final boolean AND_OPERATOR
static final boolean OR_OPERATOR
Method Detail |
---|
void addAction(RuleAction ruleAction)
ruleAction
- the action to add.
EpDomainException
- if anything goes wrong.void addCondition(RuleCondition condition)
condition
- the condition to add.
EpDomainException
- if anything goes wrong.void addEligibility(RuleEligibility eligibility)
eligibility
- the RuleEligibility
to add.
EpDomainException
- if anything goes wrong.java.util.Set getActions()
boolean getConditionOperator()
java.util.Set getConditions()
java.util.Set getEligibilities()
boolean getEligibilityOperator()
java.util.Date getEndDate()
java.lang.String getName()
java.lang.String getPromoCode()
java.lang.String getRuleCode() throws EpDomainException
EpDomainException
- if the rule is not well formedRuleSet getRuleSet()
java.util.Date getStartDate()
boolean isSingleUse()
void setActions(java.util.Set actions)
actions
- a set of RuleAction
objectsvoid setConditionOperator(boolean conditionOperator)
conditionOperator
- - the condition operator (ANR/OR).void setConditions(java.util.Set conditions)
conditions
- a set of RuleCondition
objectsvoid setEligibilities(java.util.Set eligibilities)
eligibilities
- a set of RuleCondition
objectsvoid setEligibilityOperator(boolean eligibilityOperator)
eligibilityOperator
- - the eligibility condition operator (ANR/OR).void setEndDate(java.util.Date endDate)
endDate
- the end datevoid setName(java.lang.String name)
name
- the name of the rulevoid setPromoCode(java.lang.String promoCode)
promoCode
- the promoCode of the rulevoid setRuleSet(RuleSet ruleSet)
ruleSet
- the ruleSet it belongs to.void setSingleUse(boolean singleUse)
singleUse
- set to True if this promoCode is only for single use.void setStartDate(java.util.Date startDate)
startDate
- the start datevoid validate() throws EpDomainException
EpDomainException
- if the structure is not correct.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |