Home > Class Reference > ENSLIB namespace > Ens.Rule.Rule
Private  Storage   


persistent class Ens.Rule.Rule extends
%Persistent, %XML.Adaptor

Defines a Business Rule within a Rule set.


Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 7 4 1


Actions Conditions Disabled ReturnValue RuleNo
RuleSet SubRules

%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDelete
%OnDetermineClass %Open %OpenId %OriginalNamespace
%PackageName %PhysicalAddress %PurgeIndices %Reload
%RemoveFromSaveSet %ResolveConcurrencyConflict %RollBack %Save
%SaveDirect %SaveIndices %SerializeObject %SetModified
%SortBegin %SortEnd %SyncObjectIn %SyncTransport
%UnlockExtent %UnlockId %ValidateIndices %ValidateObject
Evaluate GenerateCode XMLDTD XMLExport
XMLExportToStream XMLExportToString XMLNew XMLSchema
XMLSchemaNamespace XMLSchemaType


• parameter XMLIGNORENULL = 1;
Ensure that we don't get $C(0) for values that are empty strings


• relationship Actions as Action(XMLNAME="action",XMLPROJECTION="ELEMENT") [ Inverse = Rule,Cardinality = children ];
Collection of optional actions associated with this Rule.
• relationship Conditions as Condition(XMLNAME="condition",XMLPROJECTION="ELEMENT") [ Inverse = Rule,Cardinality = children ];
Collection of conditions that define this Rule.
• property Disabled as %Boolean(XMLNAME="disabled",XMLPROJECTION="ATTRIBUTE");
If false, then this rule is enabled; otherwise this rule is not evaluated.
• property ReturnValue as %String(MAXLEN=128,XMLNAME="return",XMLPROJECTION="ATTRIBUTE");
If defined, value returned if this Rule is true.
• property RuleNo as %Integer(XMLPROJECTION="NONE") [ InitialExpression = $I(^Ens.Rule.RuleC("RuleNo")) ];
• relationship RuleSet as Ens.Rule.RuleSet [ Inverse = Rules,Cardinality = parent ];
Parent RuleSet.
• property SubRules as list of SubRule(XMLNAME="rule",XMLPROJECTION="ELEMENT");
Collection of SubRules of this Rule.


• classmethod %OnDelete(oid As %ObjectIdentity) as %Status
This callback method is invoked by the %Delete method to provide notification that the object specified by oid is being deleted.

If this method returns an error then the object will not be deleted.

• method Evaluate(pRuleSet As RuleDefinition, pRuleNo As %Integer, pContext As %RegisteredObject, Output pValue As %Boolean, Output pErrorMsg As %String) as %Status
Evaluate this Rule.
Returns user errors via pErrorMsg.
• method GenerateCode(pCompiler As Compiler, pRuleNo As %Integer) as %Status
Generate code for this Rule.
pRuleNo gives the ordinal position of this Rule within the Rule Set.


•index (ID on RuleNo) [IdKey];
Make sure rules are ordered correctly