Question

I'm checking the documentless(!) Microsoft.RuleEngine to work with BusinessRuleComposer using C#.

I came into this sample somewhere:

RuleEngineComponentConfiguration fr = new RuleEngineComponentConfiguration("MyAssembly", "Retriever");
RuleSet rs = new RuleSet("ruleset");
// associate the execution configuration with a ruleset
RuleSetExecutionConfiguration rsCfg = rs.ExecutionConfiguration;
rsCfg.FactRetriever = factRetriever;

Is RuleSet equivalent to the Policy which is declared in the Business Rule Composer? I guess it is by the similarities in their properties!

Was it helpful?

Solution

No, they are not the same thing.

A RuleSet is the actual in memory representation of the rules that the Policy applies to the Facts. If you open a RuleSet and browse the types, you'll see it's what you've configured in the Composer. You might also be able to drill down from an instance of Policy as well (never tried ;).

To note, this API is not for executing Policies but rather for actually creating Rules. What you do in the Composer, you can do in C#.

Disclaimer: it's been about 4 years since I've worked with this part of the BRE so the memory is a bit fuzzy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top