How do you add to the BrokenRulesCollection?
I see that there is a method, AddRange(List<BrokenRule> list)
But I don't see how you can even create the list of BrokenRules because there is no constructor for the BrokenRules class and the member varaibles have no public set.
Hi,
The BrokenRulesCollection is the result of CheckRules and contains the broken rules. You should modify or add/remove items directly to instances of this class.
Instances of what class? BrokenRulesCollection?
You override AddBusinessRules, and call BusinessRules.Add. Then as your properties change, BrokenRulesCollection is updated as the rules are run.
That's what I figured out on my own...
What I was trying to do was run external rules engine that is loaded into an Activity class.
I had to create my own BusinessRules class. Then in the Execute function I use WorkflowInvoker to invoke the Activity, then store the results in the RuleContext.
I believe that's the recommended approach, and one of the reasons the rules system was reworked on Csla 4. Glad you were able to get it working!
Copyright (c) Marimer LLC