Rule Or WorkFlow

Source: Internet
Author: User

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

Also workflow engines usually give you the ability-Define business transactions & rules that is very long running. For example, can has a workflow for authorizing purchase orders, where the first step was to enter some information a Bout what needs to be purchased and then you have the rules along the lines if the purchase are for less $ okay it right away, If its between $ & $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 C Ompany change. So it makes sense to use a workflow engine in those scenarios. Other good examples of complex business transactions the can benefit from a workflow engine is making an insurance claim , authorizing a loan or a mortgage, assessing a credits 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 is good for extracting complex and changing rules from an application. Lets say you is an online retailer that ships to customer in the USA, Canada, UK, Germany, and France. You is required to charge taxes on the products do sell on your online shop but the rules for calculating taxes is diff Erent from country to country and from province to province within a country. Also Some things is exempt from the tax on one province but not in other provinces. Rule engines is great for these types of complex business rules, can change whenever the government changes their Policy. Rules engines can give you a answer right the just has to go to the rule engine say I want to run rule #10 and here is 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 Trans Action, it should is stateless working only on the inputs you provide it. Workflow engine is statefull, it must know, it's the Workflow in and must save, state to a database. Workflow engines also wait for input from external sources such as people or systems.

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

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

Rule Or WorkFlow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.