比较 Windows Workflow Foundation 中的对象属性?

发布于 2024-07-21 15:21:36 字数 286 浏览 2 评论 0原文

我们正在启动一个相当复杂的新项目,需要某种规则引擎通过比较两个对象的值来做出决策。 这是一个简单的场景:

一个帐户进入,根据其属性(余额、到期付款等),它可以适合一个或多个不同的计划。 每个计划将定义一组特定的属性,其数量和值直到运行时才会知道。 我们需要一种方法来根据计划的属性检查帐户属性,以查看帐户是否适合每个特定计划。

我认为这里一个明显的选择是利用 Windows 工作流规则。 我对工作流程完全陌生。 我的场景可以仅使用工作流 API 吗?

我在这里走的是正确的道路吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

裸钻 2024-07-28 15:21:36

是的,您可以使用 WF。 您将需要编写一个接口,定义应用程序将用于与工作流(从主机应用程序到工作流)通信的事件以及工作流将调用的与您的应用程序(从工作流到主机应用程序)通信的方法。

您可以编写事件参数类(继承 ExternalDataEventArgs

当帐户到达时, 还没有深入研究规则,但是一旦你掌握了 WF 的基础知识,我就可以很容易地完成它。 com/WileyCDA/WroxTitle/Professional-Windows-Workflow-Foundation.productCd-0470053860.html" rel="nofollow noreferrer">wrox 书 并研究了来自 MSDN 的代码示例/教程。

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.

枉心 2024-07-28 15:21:36

你的问题听起来确实需要某种规则引擎,但我不确定为什么你猜测 WF 将是最好使用的 - 除非你已经在专门针对工作流程做一些事情。 如果情况并非如此,也许您还应该问一些更一般的问题,例如“与 X 语言或 X 技术集成的简单规则引擎是什么?”

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?'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文