com.elasticpath.domain.rules
Interface RuleSet

All Superinterfaces:
Entity, EpDomain, Persistence, java.io.Serializable
All Known Implementing Classes:
RuleSetImpl

public interface RuleSet
extends Entity

Represents a set of rules.


Method Summary
 void addRule(Rule rule)
          Adds a rule to the rule set.
 java.util.Set getImports()
          Get the names of classes imported by this rule set.
 java.util.Date getLastModifiedDate()
          Returns the date when the rule set was last modified.
 java.lang.String getName()
          Get the name of this rule set.
 java.lang.String getRuleCode()
          Returns the Drools code corresponding to this rule set.
 java.util.Set getRules()
          Get the rules in this rule set.
 int getScenario()
          Get the id of the scenario that this rule set applies to.
 void setLastModifiedDate(java.util.Date lastModifiedDate)
          Set the date when the rule set was last modified.
 void setName(java.lang.String name)
          Set the name of this rule set.
 void setRules(java.util.Set rules)
          Set the rules in this rule set.
 void setScenario(int scenarioId)
          Set the scenario that this rule set applies to.
 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
 

Method Detail

addRule

void addRule(Rule rule)
Adds a rule to the rule set.

Parameters:
rule - the rule to add

getImports

java.util.Set getImports()
Get the names of classes imported by this rule set.

Returns:
the set of imports (fully qualified class names)
See Also:
addImport

getLastModifiedDate

java.util.Date getLastModifiedDate()
Returns the date when the rule set was last modified.

Returns:
the date when the rule set was last modified

getName

java.lang.String getName()
Get the name of this rule set.

Returns:
the name of this rule set.

getRuleCode

java.lang.String getRuleCode()
                             throws EpDomainException
Returns the Drools code corresponding to this rule set.

Returns:
the rule code.
Throws:
EpDomainException - if the rule set is not well formed

getRules

java.util.Set getRules()
Get the rules in this rule set.

Returns:
the rules

getScenario

int getScenario()
Get the id of the scenario that this rule set applies to.

Returns:
the scenario id (constant in RuleScenarios)

setLastModifiedDate

void setLastModifiedDate(java.util.Date lastModifiedDate)
Set the date when the rule set was last modified.

Parameters:
lastModifiedDate - the date when the rule set was last modified

setName

void setName(java.lang.String name)
Set the name of this rule set.

Parameters:
name - the name of this rule set

setRules

void setRules(java.util.Set rules)
Set the rules in this rule set.

Parameters:
rules - a set of Rule objects

setScenario

void setScenario(int scenarioId)
Set the scenario that this rule set applies to.

Parameters:
scenarioId - a constant in RuleScenarios.

validate

void validate()
              throws EpDomainException
Checks that the rule set domain model is well formed. For example, rule conditions must have all required parameters specified.

Throws:
EpDomainException - if the structure is not correct.