Sunteți pe pagina 1din 5

Rule resolution

Rule resolution is the sophisticated internal search algorithm that the system uses to find the best or most
appropriate rule instance to apply in a situation. Rule resolution applies to most, but not all, classes derived from the
Rule- base class.
Rule resolution uses as input values:
The name of the rule needed (one or more key parts)
A starting location in the class hierarchy, often determined by contet
!our Rule"et list
The current date and time, #hich may cause time-$ualified rules to take precedence
%ircumstance property and value
The value of the as-of date property
&hen to use directed inheritance and #hen to use pattern inheritance
&hile the rule resolution algorithm is fast and invisible, it is important to understand ho# it operates. "ee 'o# the
system finds rules through rule resolution for a description of this algorithm and a list of eceptions.
Rules can be defined that apply to eternal classes as #ell as internal classes. 'o#ever, no class inheritance
processing occurs during rule resolution for eternal classes.
How the system fnds rules through rule resolution
Show all
Rule resolution is the search algorithm that the system uses to find the best or most appropriate rule instance to apply in a
situation.
Rule resolution applies to all but a few rule types classes that inherit from the Rule- base class. Rule resolution does not
apply to instances of classes derived from the Work-, Data-, or any other base class.
While the rule resolution algorithm is fast and invisible, it is important to understand how it operates. s you create applications,
make your choices of values for key parts based on how you want rules to be found by rule resolution.
n in-memory rule cache helps the rule resolution process operate faster. !f the system finds an instance "or instances# of the rule
in $uestion in the cache, it accepts what is in the cache as the candidate rules and skips many steps in the resolution process "see
below#.
%enefits
&he benefits of rule resolution include'
Rules can be shared across applications and organizations. Sharing and
reuse are major benefts of object oriented software development.
Rules defned at a higher level can be overridden by more specifc rules
defned at a lower level. While this dilutes the sharing beneft, it provides
often needed feibility while bringing visibility to eceptions.
Rules can have multiple versions, even within one RuleSet, and security rules
control which users see and eecute which versions. !his facilitates
application evolution, testing, and patching.
"ne #rocess $ommander system can host multiple applications, multiple
organizations, and multiple versions of one application with minimal concern
for conficts and interference.
%pplications can be developed independently from other applications, yet
all can depend on common rules that are loc&ed 'and so won(t change).
(verview
&he inputs to the rule resolution process are'
!he &ey parts of a rule instance being sought, such as its Applies To class
and name
!he user(s RuleSet list, assembled when the user logs in
!he class hierarchy * !he structure of parent classes and subclasses below
the ultimate base class
!he user(s access roles and privileges held, determined by the access group
Security and access control rules such as %ccess of Role to "bject rules and
#rivileges
Rule availability * Which rules are available, bloc&ed, fnal, withdrawn or not
available
Whether time and date limitations a+ect which rules are available for this
session
,n some cases, the value of a circumstance property
&he output of the resolution process is the first rule found that matches all the criteria. "Sometimes no rule instance is found, and
e)ecution stops.# &he system then e)ecutes the selected rule. (ften this causes one or more additional rules to become needed.
&hese too are found by rule resolution.
&he steps in the rule resolution process are'
Step *' +heck the +ache. !f the rule is there, go to Step ,.
-sing rules already in the cache avoids additional database lookups.
Step .' +hoose instances with the correct purpose.
&he purpose, or /family name/ combines all the key properties of a rule, e)cluding the /defined on/ class.
0or an activity rule, the key properties include'
the Applies To class that the activity is defned on
the activity name
&he purpose in this case is the activity name.
0or a 0ield 1alue, the key properties include'
the Applies To class, as above
the Field Name
the Field Value
&he purpose in this case is the 0ield 2ame plus the 0ield 1alue, for e)ample /pyction3rompt.1iew4istory/.
&he system chooses all items of the appropriate purpose and puts them in a temporary list.
Step 5' Discard rules where vailability 6 2o.
&he system drops unavailable rules from the temporary list.
Step 7' Discard inapplicable RuleSets and 1ersions.
&he system drops from the list rules that belong to RuleSets and 1ersions that are not enabled for the current re$uestor. 0or
instance, if the user8s profile includes the RuleSet version &hisRuleSet' 9:-9*, rules belonging to &hisRuleSet' 97- or
&hisRuleSet' 9;- are dropped.
Step :' Discard all candidates not defined in a class in the 8ancestor tree8.
(nly rules found in classes from which the current class descends by either pattern or direct inheritance will be retained in the
list.
&his step is not used for rules which do not have the Use class-based inheritance to arrive at the correct rule to execute
bo) checked in their class definition.
Step ;' Rank remaining candidates.
&he system ranks the remaining rules on the list in order of
"verride 'rules stored in an override RuleSet. !hese rules always move to the
top of the ran&ing.)
$lass
RuleSet
-ersion
$ircumstance
$ircumstance .ate
.ate/!ime Range
2ote that
!he RuleSet and -ersion ran&ings are based on the ordered list in the user(s
profle.
% rule with a specifc 0ualifer ran&s higher than one with no 0ualifer.
$ircumstanced rules ran& alphabetically by $ircumstance value.
$ircumstance .ates ran& in descending value.
.ate/!ime ranges ran& frst by their end1date 'in ascending order) and then
by their start1date 'in descending order).
Rules which do not have the 23se class1based inheritance to arrive at the
correct rule to eecute2 bo chec&ed in their class defnition will not be
ran&ed by class.
Step ;a' Discard choices that occur after the first /default/ rule
default rule "with no $ualifiers defined# is considered a match for any +ircumstance, +ircumstance Date, or Date<&ime range.
&herefore, the process discards any rules lower in the list than the first default rule it finds.
Step =' Set the cache.
&he process adds the rules that remain on the list to the cache as being selectable for use.
Step ,' 0ind the best instance and check for duplicates.
&he process searches down the list for the first rule that'
eactly matches a $ircumstanced Rule
has the correct $ircumstanced .ate
is in the correct .ate/!ime Range
or is the default Rule, with no 0ualifers
When it finds a rule that matches these conditions, the process checks whether the ne)t rule in the list is e$ually correct. !f it is,
the process sends a message that there are duplicate rules in the system and stops processing.
!f no duplicates are found, the system prepares to use the rule that matched the listed conditions.
Step >' +heck vailability is not %locked.
&he process checks vailability again, to see whether it is set to %locked for this rule. !f it is, the system sends a message that it
could not find an appropriate rule to use.
Step *9' 1erify re$uestor is authori?ed to see the rule.
&he process finally verifies that the re$uestor has authori?ation to access the selected rule. !f so, the system uses it. !f not, is
sends a message that it could not find an appropriate rule to use.
@)ample
Aour use of an application can cause 3rocess +ommander to search for a flow rule named Repair in the class Work-+ontract-
pplication-+omplete. &he system first e)amines in the Work-+ontract-pplication-+omplete class, and then "if no match is
found# searches higher classes in the class hierarchy. (nly flow rules belonging to RuleSets and versions that are present on your
RuleSet list are candidates.
@)ceptions
few rule types have instances that are not associated with a RuleSet and version and no rule resolution processing occurs when
an instance of these classes is needed. 0or e)ample, access roles "Rule-ccess-Role-2ame rule type# must have names that are
uni$ue system-wide.
Some other rule types do not support circumstance-$ualified or time-$ualified processing.
+onsult the help topic Completing the New dialog box for each rule type for specific details.

S-ar putea să vă placă și