Rev. 5219 - An appendix to the rules manual is needed :)

Rev. 5219 - An appendix to the rules manual is needed :)

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


tiago posted on Tuesday, August 02, 2011

Hi Jonny,

[quote]

Updated rules to consider InputProperties as Dependency for PropertyRules
Updated BusinessRules.RuleSet property to clear broken rules collection when set.
Updated business rule - PrimaryProperty to virtual
Added base classes for rules:
PropertyRule - for property rule to run with no restrictions
PropertyEditRule - only when property is changed or CheckRules on client
LookupRule - async lookup rule only when a property is changed
ObjectRule - for object rule - will always return null on PrimaryProperty and throw exception when PrimaryProperty is set to a non null value.

CommonRules.CommonBusinessRule - inherits from PropertyRule (and moved Severity property to PropertyRule).

The new base classes will need some more documentation on how/when to use, etc.

JonnyBee replied on Tuesday, August 02, 2011

Hi Tiago,

We've had som discussions on the base classes and have decided to just go with

You can create your own subclasses as you like in your own code.

I'm also working a new sample - RuleTutorial - to give more detailed info on how to write rules and use the base classes.

 

 

 

tiago replied on Wednesday, August 03, 2011

Hi Jonny,

I was exactly adding BusinessRule support to CslaGenFork - read them from a DLL/EXE and fill out the form for the user type the intended values. Than you changed some of it and I reflected the changes CGF side right away. Now it changed again. Maybe I'll wait until it gets stable.

tiago replied on Friday, August 05, 2011

Hi Jonny,

Concerning PropertyRule documentation, there are two things that need to be corrected:

Regards

JonnyBee replied on Saturday, August 06, 2011

Thx Tiago,

Updated and committed to repository.

tiago replied on Saturday, August 13, 2011

JonnyBee

I'm also working a new sample - RuleTutorial - to give more detailed info on how to write rules and use the base classes. 

 

Hi Jonny,

The sample has some building problems since it's using Csla 4.1 DLL that are in the Dependencies folder.

Another note to say I was'nt aware of the following

[quote]

Csla DataPortal will enforce authorization rules for "root" objects. Please be aware that the Child DataPortal methods down NOT enforce authorization rules so to check for authorization on child merthods you MUST add this into your own code.

tiago replied on Saturday, August 13, 2011

Hi Jonny,

In the Range.cs rule

where it reads

    public Range(IPropertyInfo primaryProperty, IComparable min, IComparable max, string message)
      : this(primaryProperty, min, max)
    {
      message = message;
    }

it should read

    public Range(IPropertyInfo primaryProperty, IComparable min, IComparable max, string message)
      : this(primaryProperty, min, max)
    {
      MessageText = message;
    }

Regards

JonnyBee replied on Monday, August 15, 2011

Hi Tiago,

Thx again, Range rule and more is updated. The Samples\Dependencies folder is only updated when a release is made as these are binary files and we do not want to check in new version whenever a change is made in Csla.

tiago replied on Tuesday, August 16, 2011

removed

Copyright (c) Marimer LLC