%Api.InteropEditors.Utils
class %Api.InteropEditors.Utils
Method Inventory
- ContractRuleSet()
- ExpandRuleSet()
- GetInputPlugins()
- GetRulePerms()
- HasKey()
- HasPermsByAssistClass()
- HasPermsByRuleClass()
- HasPermsByRuleType()
- IsReadOnly()
- IsSubClass()
- SaveRule()
- evaluateRule()
Parameters
parameter AllRulesRead = 1;
parameter AllRulesWrite = 2;
parameter BusinessRulesRead = 3;
parameter BusinessRulesWrite = 4;
parameter RoutingRulesRead = 5;
parameter RoutingRulesWrite = 6;
parameter WhenCommentDelimeter = &sep;;
Comments on 'when's are stored in an attribute rather than an array of elements.
This string acts a the delimeter for the comment attribute on each when.
Methods
classmethod ContractRuleSet(actions As %DynamicArray) as %Status
Transform provided rule definition JSON to match generated rule definition structure.
Recursively iterate through the actions array of a ruleSet.
Remove each action.expression.valueObject and move each action.expression.value to action.value.
Rename each when.expression.value to when.condition and when.expression.valueObject to when.conditionObject and
deserialize when.comments array into delimeted when.comment string.
Performs inverse of ExpandRuleSet.
classmethod ExpandRuleSet(actions As %DynamicArray) as %Status
Transform generated rule definition JSON to be more complete and internally consistent.
Recursively iterate through the actions array of a ruleSet
Rename each when.condition to match action.expression naming style
and deserialize when.comment string into when.comments array.
Performs inverse of ContractRuleSet.
classmethod GetInputPlugins(contextClassName As %String, ByRef plugins As %DynamicArray) as %Status
Get properties and plugin metadata of an extended context class.
The method arguments hold values for:
namespace, Namespace to search for extensions in.
contextClassName, Context class to get properties and plugin metadata of.
classmethod GetRulePerms() as %Binary
Get permissions the current user has on rules.
Permissions are returned in a bitstring with the following mapping:
1: %Ens_Rules Read
2: %Ens_Rules Write
3: %Ens_BusinessRules Read
4: %Ens_BusinessRules Write
5: %Ens_RoutingRules Read
6: %Ens_RoutingRules Write
1: %Ens_Rules Read
2: %Ens_Rules Write
3: %Ens_BusinessRules Read
4: %Ens_BusinessRules Write
5: %Ens_RoutingRules Read
6: %Ens_RoutingRules Write
classmethod HasKey(parent As %DynamicObject, key As %String) as %Integer
Check if 'parent' has key 'key'
classmethod HasPermsByAssistClass(assistClass As %String, permStr As %String, perms As %Binary) as %Boolean
Check if the current user has specified permissions on rules that use this assist class.
Input 'permString' defines what permissions to check: valid values are "R", "W", and "RW".
Input 'perms' defines the permissions the current user has on rules:
expected format is a bitstring as returned by GetRulePerms().
Check if the current user has specified permissions on this rule class.
Input 'permString' defines what permissions to check: valid values are "R", "W", and "RW".
Input 'perms' defines the permissions the current user has on rules:
expected format is a bitstring as returned by GetRulePerms().
classmethod HasPermsByRuleType(ruleTypes As %String, permStr As %String, perms As %Binary) as %Boolean
Check if the current user has specified permissions on all rules in 'ruleTypes' input:
valid values are "B" (Business Rules), "R" (Routing Rules), "A" (All Rules), and "*" (Any Rules).
Input 'permString' defines what permissions to check: valid values are "R", "W", and "RW".
Input 'perms' defines the permissions the current user has on rules:
expected format is a bitstring as returned by GetRulePerms().
Check if this 'ruleClass' is read only for this user
Class will be considered read only if the database underlying the namespace this rule is in is read only
Check if the given 'class' is a subclass of 'superClass':
if class is guaranteed to be compiled use %Extends instead.
classmethod SaveRule(ruleClass As %String, ruleDefinition As %DynamicObject) as %Status
Save 'ruleDefinition' into class 'ruleClass'.
If a class 'ruleClass' exists it will be overwritten.
classmethod evaluateRule(pContext As %RegisteredObject, pRuleName As %String, Output pRuleLogData As %String = "", pDebugFlags As %String = "crd", pSelectMode As %Integer = 2) as %Status
Given a context object evaluate the rule and create result output as JSON