规则引擎适用性 [英] Rules Engine Suitability

查看:73
本文介绍了规则引擎适用性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使员工能够编写自己的规则来计算我们销售产品的价格.价格信息可以来自我们数据库中的各种表格.公式示例可能类似于:

I am currently trying to provide staff with the ability to write their own rules for calculating prices for products that we sell. The price information can come from various tables within our database. An example formula might be something like:

ValueOfProductReceived = ValueAddRule.Price *与这些表相关的SUM(PurchaseOrderLines.QuantityReceived).

ValueOfProductReceived = ValueAddRule.Price * SUM(PurchaseOrderLines.QuantityReceived) where these tables are related.

或者对于那些有SQL倾向的人,这是我如何获取modelid收到的产品总价值的方法

Or for the SQL inclined people, here is how I get the total value of product received by modelid

SELECT vr.ModelID, vr.[Amount] * 
(
	SELECT SUM(pol.QuantityReceived)
	FROM sssp.tPurchaseOrderLine pol
	WHERE pol.LastReceiptDate BETWEEN vr.StartDate AND vr.EndDate
	AND pol.ProductID in 
	(SELECT [ProductID] FROM sSSP.tModelVariant WHERE ModelID=vr.ModelID)
) as ValueOfProductReceived
FROM sssp.[tValueAddRule] vr

 我正在尝试确定工作流是否是为他们提供此功能的正确工具.我不希望他们编写需要编译和部署的代码.我希望他们能够建立他们的查询并将规则保存到数据库中.然后他们 可以选择并执行每个规则,或者我们可以让他们在计划的时间运行规则.

 I am trying to work out if workflow is the right tool for giving them this ability. I don't want them writing code that needs to be compiled and deployed. I want them to be able to build their queries and have the rules saved to a database. Then they can select each rule and execute it, or we can give them the ability to run the rules at scheduled times.

所以我想第一个问题是,这是适合该工作的工具,其次,如果它是正确的工具,我将如何实施?

So I guess the first question is, Is this the right tool for the job, and secondly, how would I go about implementing this if it is the right tool?

推荐答案

工作流程4.0的主要功能似乎可以支持您的方案,它是可托管的表达式编辑,可通过VB表达式以及自变量和变量来实现.

您可以使用工作流程4.0,尤其是如果您受益于工作流程的核心功能,但是除非您拥有工作流程的其他功能,否则我不认为与重新托管某些脚本语言(如IronPython)相比,它有什么优势 等等...

The main feature in workflow 4.0 that looks like it could support your scenario is the rehostable expression editing, which works by VB expressions, and arguments and variables.

You could use workflow 4.0, especially if you benefit from core feature of workflow, but unless you have other features of workflow that you benefit from, I don't see what the advantage would be compared to rehosting some scripting language like IronPython etc...

Tim


这篇关于规则引擎适用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆