博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Rule Or WorkFlow
阅读量:7070 次
发布时间:2019-06-28

本文共 3084 字,大约阅读时间需要 10 分钟。

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

转载地址:http://lgqll.baihongyu.com/

你可能感兴趣的文章
手把手教你用动软.NET代码生成器实例教程
查看>>
栈分配的速度快于堆
查看>>
[转] 使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制
查看>>
CF-Pasha and Tea(贪心6)
查看>>
ASCII_01
查看>>
Mac控制远程Linux服务器
查看>>
R语言基础命令与安装
查看>>
SDWebImage从缓存中获取图片
查看>>
python基础一
查看>>
mongodb集合的增删
查看>>
LeetCode 161: One Edit Distance
查看>>
SPOJ220 Relevant Phrases of Annihilation
查看>>
python基础学习10----集合
查看>>
ETL工具—Kettle数据的导入导出—批量Excel表到数据库
查看>>
知识思考
查看>>
OpenCV安装
查看>>
在一行上打印(完成度打印)
查看>>
linux运维人员常用的150个命令
查看>>
boost库 线程使用
查看>>
FPGA笔试必会知识点1--数字电路基本知识
查看>>