|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RulesetContext
This class provides tools necessary when editing a rule. This includes the ability to open other rules according to the RuleSets visible to a rule, and the ability to record certain types of objects that a rule refers to
Currently, the following references are tracked:
open(com.pega.pegarules.pub.util.StringMap) or
openForAllCircumstanceVals(com.pega.pegarules.pub.util.StringMap, com.pega.pegarules.pub.database.RuleResolutionInformation) method is called.validatePagesAndClasses(com.pega.pegarules.pub.clipboard.ClipboardProperty, com.pega.pegarules.pub.clipboard.ClipboardProperty) is called, or when
addNamedPageReference(java.lang.String) is called.addAPIMethodReference(java.lang.String, java.lang.String, java.lang.String[]) method is called.startTrackingReferences(), and disabled by calling
stopTrackingReferences().
Instances of this class can also find a version of a rule that is related to a given version. Two rules are related if they have the same rule name.
| Field Summary | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
VERSION
|
| Method Summary | |
|---|---|
void |
addAPIMethodReference(java.lang.String aClassName,
java.lang.String aMethodName,
java.lang.String[] aParameterTypes)
Records a call to an API method, if reference tracking is enabled. |
void |
addNamedPageReference(java.lang.String aPageName)
Records a reference to a named page, if reference tracking is enabled. |
java.lang.String |
findHandle(StringMap aKeys)
Finds the handle of the instance that would be opened from the RuleSet context, given a set of keys. |
boolean |
findRuleInClassSet(StringMap aKeys,
java.util.Set aClassToTry)
Looks for the specified rule in any of the classes given in the aClassToTry list. |
ClipboardPage |
getClosestVersion(ClipboardPage aRulePage)
Returns the version of a rule that is most closely related to a given version. |
Dictionary |
getDictionary()
Returns a Dictionary that uses the this RuleSet context to open rules, and that tracks references in this RuleSet context's rule page. |
java.util.List |
getListOfRulesets()
Returns a list of Strings representing the unlocalized rulesets in this RulesetContext. |
boolean |
isBasisOf(ClipboardPage aVersion1,
ClipboardPage aVersion2)
Is one version of a rule the basis of another version. |
boolean |
isClassVisible(java.lang.String aClassName)
Indicates whether a particular class is visible to the rule being edited (according to the list of rulesets). |
ClipboardPage |
open(StringMap aInstancePage)
Opens an instance given its key properties. |
ClipboardPage |
openDefault(StringMap aKeys)
Opens the default version of the Rule with the given keys. |
java.util.Map |
openForAllCircumstanceVals(StringMap aInstancePage,
RuleResolutionInformation aRuleInfo)
Deprecated. |
void |
openRuleUtilityFunction(StringMap aKeyPage)
Opens the undecorated and decorated(if any) Rule-Utility-Function instances and add it to Rule Referencing. |
void |
startTrackingReferences()
Causes this RuleSet context to track references. |
void |
stopTrackingReferences()
Causes this RuleSet context to stop tracking references. |
void |
validatePagesAndClasses(ClipboardProperty aPagesAndClassesProperty,
ClipboardProperty aParameterProperty)
Validates the pages and classes table for the rule. |
| Field Detail |
|---|
static final java.lang.String COPYRIGHT
static final java.lang.String VERSION
| Method Detail |
|---|
void startTrackingReferences()
void stopTrackingReferences()
ClipboardPage openDefault(StringMap aKeys)
throws BadClassDefinitionException,
ConfigurationException,
MultipleCircumstancePropertiesException,
MultipleRuleVersionException,
BadInputException,
BadInstanceDataException,
DatabaseException
This method may be used to open data instances also--if the
data instance being opened contains a pyRuleSet
property with a non-blank value, then the open succeeds only
if the value of pyRuleSet is the name of at least
one of the RuleSets in the list--otherwise, it returns null.
The rule being opened is added to the list or referenced rules.
aKeys - the instance's key parts
null if it
does not exist
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass.
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting Circumstance Properties or with
conflicting Circumstance Date Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule Resolution, and
there is more than one version of the rule that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a default version of the
Rule was expected but not found
BadInputException - if there is a problem with the key page.
The processing status is set to the error Database-BadInput-ClassCannotHaveInstances.
Examples of problems are:
Code-.BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the
database
ClipboardPage open(StringMap aInstancePage)
throws DatabaseException
This method may be used to open data instances also--if the
data instance being opened contains a pyRuleSet
property with a non-blank value, then the open succeeds only
if the value of pyRuleSet is the name of at least
one of the RuleSets in the list--otherwise, it returns null.
If the instance that is opened is a rule, then it is added to the list of rules referenced by the rule being edited.
aInstancePage - a page containing the instance's key
properties (including pxObjClass)
null if it
does not exist
DatabaseException - if there is a problem opening the instance
void openRuleUtilityFunction(StringMap aKeyPage)
throws DatabaseException
aKeyPage - contains instance's key part
DatabaseException - if there is a problem opening the instance
java.util.Map openForAllCircumstanceVals(StringMap aInstancePage,
RuleResolutionInformation aRuleInfo)
throws DatabaseException
If the instance that is opened is a rule, then it is added to the list of rules referenced by the rule being edited.
aInstancePage - a page containing the instance's key
partsaRuleInfo - filled in with information about the returned rule
CircumstanceResult.
If there is a default result (that is, a version that is to be used if none
of the circumstance-qualified versions match), then it
is stored in the map with a null key. (This map should
not be updated--it might be read-only.)
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass.
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if more than one circumstance property is found
BadInputException - if there is a problem with the key page
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the
database
ClipboardPage getClosestVersion(ClipboardPage aRulePage)
throws DatabaseException
aRulePage - a version of a rule
aRulePage, which
is most closely related to it; or null if there are
no versions related to it
BadClassDefinitionException - if the instance is of (or defined on) an bad class
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if more than one circumstance property is found
MultipleRuleVersionException - if more than one version of the rule is found
BadInputException - if there is a problem with the rule page--or if
the page is not of a class that uses rule resolution
or class inheritance
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the
database
boolean isBasisOf(ClipboardPage aVersion1,
ClipboardPage aVersion2)
aVersion1 - the first rule versionaVersion2 - the second rule version
java.lang.IllegalArgumentException - if aVersion1 and
aVersion2 are not versions
of the same ruleboolean isClassVisible(java.lang.String aClassName)
aClassName - the name of the class
void addNamedPageReference(java.lang.String aPageName)
aPageName - the name of the page
void addAPIMethodReference(java.lang.String aClassName,
java.lang.String aMethodName,
java.lang.String[] aParameterTypes)
aClassName - the name of the Java class to which the method belongs,
with complete packageaMethodName - the name of the methodaParameterTypes - the types of parameters for the method, with complete
package names where appropriate
void validatePagesAndClasses(ClipboardProperty aPagesAndClassesProperty,
ClipboardProperty aParameterProperty)
aPagesAndClassesProperty - property containing the pages and
classes informationaParameterProperty - the parameters property for the rule, or null if noneDictionary getDictionary()
java.lang.String findHandle(StringMap aKeys)
throws DatabaseException
Instances opened through this method are not added as a reference to the Rule being edited.
This method may be used to open both Rule-Resolved instances and non-Rule-Resolved
instances. When opening non-Rule-Resolved instances, it does not check the
pyRuleSet property on the instance, as open(com.pega.pegarules.pub.util.StringMap) does.
aKeys - the keys of the instance in question
pzInsKey of the instance that is named by
those keys, or null if such an instance does not exist
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass.
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting
Circumstance Properties or with conflicting Circumstance Date
Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule
Resolution, and there is more than one version of the rule
that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a
default version of the Rule was expected but not found
DatabaseException - if there is a problem with the database
boolean findRuleInClassSet(StringMap aKeys,
java.util.Set aClassToTry)
throws DatabaseException
aKeys - the keys for the rule to findaClassToTry - the set of class names to try
DatabaseException - if there is a database problem or a rule resolution problemjava.util.List getListOfRulesets()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||