IBM Support

Sort in Rule Team Server uses alphanumeric values for priority instead of numeric values

Question & Answer


Question

Why do the rules not appear sorted by priority ?

Answer

The priority can be expressed not only as a numeric value, but also as an expression in the rule language that can use a ruleset variable (i.e. dynamic priority). For more information on dynamic priorities, see:
The section on how to set simple priorities among rules: http://publib.boulder.ibm.com/infocenter/brjrules/v7r1/topic/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global482.html
The section on the priority keyword in the technical rule language reference: http://publib.boulder.ibm.com/infocenter/brjrules/v7r1/topic/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global1894.html

If you are only using numeric values in your rule projects, the best way is to use priorities with the same number of digits.

In addition, you can also customize Rule Team Server to automatically add any number of zeroes to the left of each priority, and ensure that they all have the same number of digits.
To this effect, you must define a custom session controller that will modify the priority of a rule just before any change is committed to the database (i.e. when you click on "finish" while editing a rule). This is done by overriding the onCommitElement() method of the interface IlrSessionController.
For more information on how to write a custom session controller, see:
http://publib.boulder.ibm.com/infocenter/brjrules/v7r1/topic/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global1616.html
To get started with session controllers, check the "Related Information" of this page which contains links to two samples that implement a session controller (Permission management sample and Governance sample).

[{"Product":{"code":"SS6MUU","label":"WebSphere ILOG Rule Team Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSQP76","label":"IBM Operational Decision Manager"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Modules:Rule Team Server","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0;7.5","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
10 August 2022

UID

swg21591819