规则引擎适用性

编程入门 行业动态 更新时间:2024-10-27 18:27:26
本文介绍了规则引擎适用性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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 selecteach 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 workflow4.0that 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 seewhat theadvantage would be compared to rehosting some scripting language like IronPython etc...

Tim

更多推荐

规则引擎适用性

本文发布于:2023-06-01 10:47:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/413446.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:适用性   规则   引擎

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!