views:

568

answers:

5

At the moment I'm developing a web based application using Silverlight 3.0. For the business rules I'm looking for a rules engine that's both easy to use for me and my users, which will work with SL3. Is something like that available out of the box or will I need to roll my own?

I've Googled and looked around the various code sites (Codeplex, Code Project etc), but didn't see anything that suits my needs.

I did also have a good long look at NxBRE, but it's Rules syntax is too complex for 'dummy' users.

+1  A: 

What about the rules engine that comes with Windows Workflow Foundation?

http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/08/09/WF-Rules-Engine-without-Workflow.aspx

Robert Harvey
Yes, consider that. Don't make the Rules engine UI dependent
Peter Gfader
I did look at that, but also read that the Rules are quite simple. Can you do something like: If Rule1== true then do Rule2 else do Rule3?
A: 

I've searched around a bit more, and decided that Rules Engines actually don't fulfill our requirements. We don't need rules, we want to do calculations on a property when the value of that property changes.

Thanks for your answers,

Cheers, Frances

+1  A: 

For people who stumbled upon this thread looking to use NxBRE as a Rules Engine with Silverlight (SL), here is my two cents.

  1. I tried referencing NxBRE dll in my SL project with no luck. SL does NOT allow dlls that are not built using SL CLR to be referenced in an SL project.
  2. Fortunately NxBRE is an open source project so I downloaded the source files to build it using SL CLR.
  3. SL does not support a lot of .NET types, namely objects in namespaces System.Xml.XPath, System.Xml.XPath etc. These are required for NxBRE to compile.

So I had NO luck using NxBRE with SL. These are my first impressions, if I find more by digging deeper I shall let you guys know.

Hope this is of help to someone out there.

Thanks Sai Gudigundla

Sai Gudigundla
A: 

For those who might be interested: eventually we went for CSLA .Net for Silverlight

A: 

Back to the original rule engine question...

If you want to run the rule engine inside of Silverlight, you would need to find one that has been built to only use the limited subset of .NET that Silverlight supports. For example, Silverlight supports generic collections (List) but not untyped collections (List).

At this moment, I don't know of a .NET rule engine that has been (re-)targeted to the Silverlight CLR.

Furthermore, while there are interesting applications for client-side rule engines (for example: in the browser or on a mobile device), one should always consider whether the rule engine is more appropriately hosted on the back end. Take into consideration how frequently the rules are called, how much data is being moved around, etc.

kreinsch