How to run business rules in all child and sub-child objects of a parent object
How to run business rules in all child and sub-child objects of a parent objectOld forum URL: forums.lhotka.net/forums/t/10746.aspx
Holger posted on Friday, October 07, 2011Is there a build-in function in CSLA 4.0 to run all business rules for the complete edit-object-tree.
I need to run all rules, even the user made no changes. Sometimes we have the case, that our data
gets updated by script and we need to re-run all rules when the user edits data.
JonnyBee replied on Friday, October 07, 2011
No, there is no built-in function for that.
The primary function is that all rules should be rerun when a value is edited.
You will need to create a function that walks the edit-object tree and call CheckRules on all editable objects.
Have a look at the ICheckRules interface for calling CjeckRules.
Holger replied on Friday, October 07, 2011
Can you add this to the featurelist for the next release?
I think everything is there to implement this in an easy way (FieldManager.GetAllChilds + BusinessRules.CheckRules).
Copyright (c) Marimer LLC