views:

71

answers:

2

We are starting a rather complex new project at work, and need some sort of rules engine to make decisions by comparing the values of 2 objects. Here is a simple scenario:

An account comes in, and based on its properties (balance, payment due, etc), it can fit into one or many different plans. Each plan will define a specific set of attributes, the number and value of which will not be known until run time. We need a way to check the account properties against the properties of the plan to see if the account fits into each specific plan.

I thought an obvious choice here would be to utilize Windows Workflow rules. I am completely new to Workflow. Is my scenario possible using just the Workflow APIs?

Am I even going down the right path here?

+1  A: 

Yes you can use WF. You will need to write an Interface defining events that you application will use to communicate with workflow (from Host application to Workflow) and methods that workflow will call to communicate with your application (from workflow to Host application).

You can write your event argument class (inheriting ExternalDataEventArgs that contains the Account object. When an account arrives you will raise workflow event and pass your event argument object containing account. Once it is available in workflow you can compare its properties with values from rules.

PS:- I'm also new to workflow. Haven't yet dived into rules stuff but it can be done fairly easily once you grasp fundas of WF. I've read a wrox book and studied code samples/tutorials form MSDN.

TheVillageIdiot
A: 

Your problem does sound like it needs a rule engine of some kind, but I am not sure why you are guessing WF will be the best one to use - unless you are already doing something specifically with workflow. If that is not the case maybe you should also ask some more general questions like 'what is an easy rule engine to integrate with X language or X technology?'