Retrieving Definition Objects at Runtime

  • Updated

Prerequisites: A valid RuleSession
Namespaces: InRule.Runtime, InRule.Repository, InRule.Repository.RuleElements
Classes: EntityDef, FieldDef, RuleSetDef, RuleElementDef, Entity, Field, RuleSet, RuleElement
See Also: Using Element Metadata

The following examples demonstrate how to retrieve definition objects through the runtime objects. These objects can then be utilized to access object metadata and user-defined attributes.

// Get EntityDef from Entity
EntityDef entityDef = entity.GetDef();

// Get FieldDef from Field
FieldDef fieldDef = field.GetDef();

// Get CollectionDef from Collection, assigned to FieldDef
FieldDef collectionDef = collection.GetDef();

// Get RuleSetDef from RuleSet
RuleSetDef ruleSetDef = (RuleSetDef)ruleSet.GetDef();

// Get RuleElementDef from RuleElement, getting first child element in this example
RuleElementDef ruleElementDef = ruleSet.RuleElements[0].GetDef();

 

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.