Brokenrules

Brokenrules

Old forum URL: forums.lhotka.net/forums/t/1061.aspx


yh_ink posted on Tuesday, August 29, 2006

Hi,

I would like to know about setting brokenrules.

 how should i set broken rule in case i have a get static method and dataportal fetch.And i am checking for null data.if i get null data for particular property from webform i want to set broken rule

From my webform i call get i set brokenrules in the business properties but it does not work.

how should i set...please show me an example how to set in businessproperty

Can the brokenrules be set only in case of read/write involved  or can it be set even for read alone???

thanks

 

RockfordLhotka replied on Tuesday, August 29, 2006

It depends on whether you are running 1.x or 2.0, and if running 1.x whether you are using the RuleManager concept or not.

In 1.x you can use BrokenRules.Assert() to directly check rules. This was discussed in the previous editions of the books, and you can find examples in the 1.x ProjectTracker app. There are also many discussions on ways to organize your rules on the old forum - searchable at www.searchcsla.com.

In 1.3+ you can create rule methods and associate them with properties, and then call CheckRules() to check those rules. The concept is basically the same as the 2.0 approach, but some classes/methods are a bit different. You can find details on how to do this in the 1.3 release notes (http://www.lhotka.net/Article.aspx?id=12983bcf-4599-4a11-917c-72f3d473883e).

In 2.0 you can create rule methods and associate them with properties as described in the book. The Assert() concept does not exist in 2.0.

Copyright (c) Marimer LLC