public interface RulesetContext
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
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 |
addDataPageAsRuleReference(StringMap aPropertyKeys)
Adds a reference to data page rule (without trying to open it).
|
void |
addNamedPageReference(java.lang.String aPageName)
Records a reference to a named page, if reference tracking
is enabled.
|
void |
addNamedPageReference(java.lang.String aPageName,
java.lang.String aPageClass)
Records a reference to a named page, if reference tracking
is enabled.
|
void |
addRuleReferencingInfo(java.lang.String libraryName,
java.lang.String functionName,
java.lang.String decoratedFunctionName,
java.lang.String methodStatus)
Massage the inputs and add resulting info to Referencing Rule.
|
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.
|
ClipboardPage |
getClosestVersionOrCurrentRule(ClipboardPage aRulePage)
Returns the version of a rule that is most closely related
to a given version or the rule itself including checked out rules
|
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.
|
static final java.lang.String VERSION
static final java.lang.String COPYRIGHT
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 partsnull
if it
does not existBadClassDefinitionException
- 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 badMultipleCircumstancePropertiesException
- if, during Rule Resolution, Rules with conflicting Circumstance Properties or with
conflicting Circumstance Date Properties were encounteredMultipleRuleVersionException
- 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 versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a default version of the
Rule was expected but not foundBadInputException
- 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 corruptDatabaseException
- if there is a problem with the
databaseClipboardPage 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 existDatabaseException
- if there is a problem opening the instancevoid openRuleUtilityFunction(StringMap aKeyPage) throws DatabaseException
aKeyPage
- contains instance's key partDatabaseException
- if there is a problem opening the instancevoid addRuleReferencingInfo(java.lang.String libraryName, java.lang.String functionName, java.lang.String decoratedFunctionName, java.lang.String methodStatus)
libraryName
- - RUF library namefunctionName
- - RUB function name in the RUF librarydecoratedFunctionName
- - the decorated function namemethodStatus
- - the methodStatus of the rule instance or rule typejava.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 ruleCircumstanceResult
.
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 badMultipleCircumstancePropertiesException
- if more than one circumstance property is foundBadInputException
- if there is a problem with the key pageBadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseClipboardPage getClosestVersion(ClipboardPage aRulePage) throws DatabaseException
aRulePage
- a version of a ruleaRulePage
, which
is most closely related to it; or null if there are
no versions related to itBadClassDefinitionException
- if the instance is of (or defined on) an bad classConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if more than one circumstance property is foundMultipleRuleVersionException
- if more than one version of the rule is foundBadInputException
- if there is a problem with the rule page--or if
the page is not of a class that uses rule resolution
or class inheritanceBadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseClipboardPage getClosestVersionOrCurrentRule(ClipboardPage aRulePage) throws DatabaseException
aRulePage
- a version of a ruleaRulePage
, which
is most closely related to it; or itself if there are
no versions related to itBadClassDefinitionException
- if the instance is of (or defined on) an bad classConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if more than one circumstance property is foundMultipleRuleVersionException
- if more than one version of the rule is foundBadInputException
- if there is a problem with the rule page--or if
the page is not of a class that uses rule resolution
or class inheritanceBadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseboolean isBasisOf(ClipboardPage aVersion1, ClipboardPage aVersion2)
aVersion1
- the first rule versionaVersion2
- the second rule versionjava.lang.IllegalArgumentException
- if aVersion1
and
aVersion2
are not versions
of the same ruleboolean isClassVisible(java.lang.String aClassName)
aClassName
- the name of the classvoid addDataPageAsRuleReference(StringMap aPropertyKeys)
aPropertyKeys
- void addNamedPageReference(java.lang.String aPageName)
aPageName
- the name of the pagevoid addNamedPageReference(java.lang.String aPageName, java.lang.String aPageClass)
aPageName
- the name of the pageaPageClass
- the class of the pagevoid 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 appropriatevoid 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 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 questionpzInsKey
of the instance that is named by
those keys, or null if such an instance does not existBadClassDefinitionException
- 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 encounteredMultipleRuleVersionException
- 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 versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a
default version of the Rule was expected but not foundDatabaseException
- if there is a problem with the databaseboolean findRuleInClassSet(StringMap aKeys, java.util.Set aClassToTry) throws DatabaseException
aKeys
- the keys for the rule to findaClassToTry
- the set of class names to tryDatabaseException
- if there is a database problem or a rule resolution problemjava.util.List getListOfRulesets()
Copyright © 2018 Pegasystems Inc. All Rights Reserved.