Rule Or WorkFlow

The main value of a Workflow engine is that it makes it possible to customize the flows through some workflow definition DSL. If you don‘t need to allow users to define their own arbitrary workflows, they you are better off just building your own.

Also workflow engines usually give you the ability to define business transactions & rules that are very long running. For example, you can have a workflow for authorizing purchase orders, where the first step is to enter some information about what needs to be purchased, then you have rules along the lines if the purchase is for less $100 okay it right away, if its between $100 & $2000 line manager can okay, if it‘s more then send it to some one else for approval ... etc. These types of business rules tend to change over the years as the amounts get increased, or the business policies for a company change. So it makes sense to use a workflow engine in those scenarios. Other good examples of complex business transactions that can benefit from a workflow engine are making an insurance claim, authorizing a loan or a mortgage, assessing a credit application from a customer ... etc. These business transactions tend to go through several people / departments and take several hours to days or weeks to complete.

Rule engines are good for extracting complex but changing rules from an application. Lets say you are an online retailer that ships to customer in the USA, Canada, UK, Germany, and France. You are required to charge taxes on the products you sell on your online shop but the rules for calculating taxes are different from country to country and from province to province within a country. Also some things are exempt from tax in one province but not in other provinces. Rule engines are great for these types of complex business rules that can change whenever the government changes their tax policy. Rules engines can give you an answer right way you just have to go to the rule engine say I want to run rule #10 and here are the inputs for rule #10 x,y,z and you get back an answer.

Main differences between a rule engine and a workflow engine, is that rule engine does not track the state of the transaction, it should be stateless working only on the inputs you provide it. Workflow engine is statefull, it must know what current state is the workflow in and must save that state to a database. Workflow engines also wait for input from external sources such as people or systems.

From what you are describing about your app I would just write some groovy classes to compute the next state of a ticket and make sure that the class is well documented and easy to update in a few years. I think rule engines and workflow engines are overkill for your situation, the amount of time it would take you to set them up and use them is much bigger that it would take you to write the code in groovy. If over time you discover you need the complexity of rule engines and workflow engines, I would pay the price then rather than now, keeping it simple is always the best choice.

http://www.infoq.com/articles/Rule-Engines

时间: 2024-10-11 03:32:29

Rule Or WorkFlow的相关文章

APEX初步 [3] —— Apex触发器

触发器概念 apex触发器就像数据库中的触发器一样,用来在增删改之前或之后对记录执行自定义的操作,也可以添加触发的条件.它可以做任何apex能做的功能,比如执行SOQL语句或者调用其他apex方法.它可以被定义在Sobejct上,比如account,contact或者自定义对象上. 尽量在无法通过普通的点击操作的设置完成的情况下才使用触发器,比如如果要验证一个字段的值或更新一条记录上的某个字段,就应该使用validation rule 和 workflow. 触发器格式 trigger Trig

.net Framework Class Library(FCL)

from:http://msdn.microsoft.com/en-us/library/ms229335.aspx 我们平时在VS.net里引用的那些类库就是从这里来的 The .NET Framework class library is a library of classes, interfaces, and value types that provides access to system functionality and is designed to be the foundat

转-git feature branch workflow

https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow Getting Started Setting up a repository git init git clone git config Saving changes git add git commit Inspecting a repository git status git log Viewing old commits

【翻译习作】 Windows Workflow Foundation程序开发-第一章05

1.3      开发我们的第一个工作流 也许你曾经在这样的产品经理手下搞过开发:他总是在你身边转悠,并不时的问一句“你还没做完吗?”.在这一部分,我们将用一个简单的Windows Workflow程序把这个招人烦的产品经理替换掉.这个例程无法向你展示WF平台的全部功能,但它可以让你领略到如何用WF创建并运行工作流. 在开始之前,我们需要下载并安装.NET 3.0框架.安装程序可以在 http://netfx3.com 找到.Visual Studio 2005的所有版本都支持在.NET 3.0

workflow 4.0

Workflow 4.0 1.  新建项目,选择.net framework4.5,然后选中C#分支里的workflow,最后选择活动库创建一个workflow项目. 2.  在xaml设计界面拖入一个Sequence控件,Sequence代表一个顺序流,会按照顺序执行. 3.  属性中的displayname可以设置备注名,以使得工作流更清晰的展现流程过程. 4.  为了更灵活的配置工作流和之后的修改,可以把工作流分支化,把一些具体的实现流程写到代码活动中,只在工作流中引用,避免主工作流复杂化

Windows Workflow开发演练

1     入手 1.1      工作流项目模板 1.2      最基本的顺序模型 1.3      通过参数传递数据 1.4      实现自定义活动 2     提高 2.1      通过工作流实现远程对象的业务 2.1.1       实现基本的远程对象 2.1.2       对远程对象改进 2.1.3       通过工作流实现远程对象的业务逻辑 2.2      调用外部方法 2.2.1       简单的无参无返回值调用 2.2.2       传递参数 2.2.3     

Architecture options to run a workflow engine

This week a customer called and asked (translated into my own words and shortened): “We do composite services, orchestrating two or three CRUD-Services to do something more useful. Our architects want to use your workflow engine for this because the

SharePoint Workflow架构(一)SharePoint 和Workflow Runtime的结合

[译者按]Andy Li这篇文章,是我看过的最好的,最透彻的关于SharePoint Workflow架构的文章.通过阅读他的文章,我才清楚的了解了SharePoint Workflow的运作机制,并且在遇到问题的时候,知道如何下手查找问题.因此翻译过来,希望对Workflow的开发人员有帮助. 这篇博客是由Andy Li贡献的,他是SharePoint开发人员支持组的处理疑难问题的工程师.原文地址.这个关于Workflow的系列,是他贡献给社区的,帮助大家更好的理解Workflow运行时的内部

深入理解OpenERP的工作流(Workflow)

原文源自老肖 一.工作流定义:< ?xml version="1.0"?>  < terp><data>    <record model="workflow" id=workflow_id>    <field name="name">workflow.name</field>    <field name="osv">resource.mo