Opening a Rule Application for Execution

  • Updated

Prerequisites: None
Namespaces: InRule.Runtime
Classes:   FileSystemRuleApplicationReference, InMemoryRuleApplicationReference, CatalogRuleApplicationReference

InRule provides the ability to execute rules from the file system, catalog, or a rule application created in memory.


// Get the ruleapp from the file system.
RuleApplicationReference ruleAppRef = new FileSystemRuleApplicationReference("C:\\RuleApps\\Invoice.ruleapp");


// The URI for the catalog service.
string Uri = "http://localhost/InRuleCatalogService/Service.svc";

// Get the ruleapp from the repository using the URI, Username, Password, and Rule Application name.
CatalogRuleApplicationReference ruleAppRef = new CatalogRuleApplicationReference(Uri, "CustomerInvoice", "Admin", "password");

// If you are using active directory,  you only need the Uri and application name
ruleAppRef = new CatalogRuleApplicationReference(Uri, "CustomerInvoice");

// you can also specify a version e.g 2
ruleAppRef = new CatalogRuleApplicationReference(Uri, "CustomerInvoice", "Admin", "password",2);

// Using a label for example PRODUCTION
ruleAppRef = new CatalogRuleApplicationReference(Uri, "CustomerInvoice", "Admin", "password", "PRODUCTION");

// Using background version polling and recompilation after the refresh interval has expired
ruleAppRef = new CatalogRuleApplicationReference(Uri, "CustomerInvoice", "Admin", "password", "PRODUCTION", true);


// Open an InMemoryRuleApplicationReference  using the RuleApplicationDef object

// Used when you have a rule RuleApplicationDef object available in memory,

// for example when dynamically generating rule applications via the Repository SDK.
RuleApplicationReference ruleAppRef = new InMemoryRuleApplicationReference (ruleApplicationDef)

Was this article helpful?

0 out of 0 found this helpful



Please sign in to leave a comment.