Using the RuleApplicationDef Object

  • Updated

Prerequisites: A valid RuleSession
Namespaces: InRule.Runtime
Classes: RuleApplicationDefInfo, RuleApplicationDef, DataElementDef, EntityDef
See Also: Creating a RuleSession

RuleApplicationDef metadata

// System and user-defined attributes
string attributeValue = ruleSession.GetRuleApplicationDef().Attributes["MyAttribute"];

// Categories defined in the rule application
CategoryDefCollection categories = ruleSession.GetRuleApplicationDef().Categories;

// Getting name of first category in collection
string catalogName = categories[0].Name;

// Getting DataElementDef
DataElementDef dataElementDef = (DataElementDef)ruleSession.GetRuleApplicationDef().DataElements["MyInlineTable"];

Iterate through the entities of a rule application

// Iterate through the entities for the rule application
foreach (EntityDef entityDef in ruleSession.GetRuleApplicationDef().Entities)
{
  Console.WriteLine(entityDef.Name);
}

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.