Compare properties of objects in Windows Workflow Foundation?

We're starting a fairly complex new project at work and need some kind of rule engine to make decisions by comparing the values ​​of two objects. Here's a simple scenario:

An account is included and based on its properties (balance, payment, etc.), it can fit into one or more different plans. Each plan will define a specific set of attributes, the number and meaning of which are unknown until runtime. We need a way to check account properties against plan properties to see if the account is appropriate for each specific plan.

I thought the obvious choice here would be to use Windows Workflow rules. I am completely new to Workflow. Can my script only be used with the Workflow API?

Am I even walking the right path here?

0


a source to share


2 answers


Yes, you can use WF . You will need to write an interface that defines the events that the application will use to communicate with the worker process (from the host application to the worker thread) and the methods that the worker process will call to communicate with your application (from the worker process to the host application).

You can write an event argument class (inheriting from ExternalDataEventArgs , which contains an Account object. When an account comes in, you increment the workflow event and pass an event argument object containing the account. Once available in the workflow, you can compare its properties with values ​​from the rules.



PS: - I'm also new to the workflow. Haven't dived into the rules yet, but it can be done quite easily once you take WF funds. I read the wrox book and studied the code samples / tutorials from MSDN.

+1


a source


Your problem sounds like it needs a rules engine, but I'm not sure why you would assume WF would be the best one to use - unless you're already doing something specific with the workflow. If this is not the case, perhaps you should also ask some more general questions, for example, "What is a simple rule engine for integrating with X language or technology X?"



0


a source







All Articles