Monday, December 04, 2006

Process Orchestration, Human workflow and Business Rules

When evaluating process orchestration, people often ask: "How does BPEL relate to human workflow and to business rules?" There is clearly some overlap in what these technologies do and then there is the issue of which of them is in control. Does your process orchestration invoke human workflow or is it the other way around? When considering this it is worth identifying their core competencies for each technology.

BPEL is designed for the task for orchestrating web services, especially where stateful long-running interactions involving peer-to-peer message exchanges are used. The BPEL engine provides reliability and recoverability and can be used in conjunction with reliable transports to provide end-to-end processing reliability. BPEL’s error recovery and compensation mechanisms are also an import consideration in service orchestration.

Human workflow systems provide the features necessary when assigning tasks to humans. Task lists are presented in a variety of forms, calendars and reminders can be used to indicate when tasks should be completed. Procedures for the escalation of tasks which have not been completed may also be enforced by the workflow system. For example, if you don’t complete a task, your manager may automatically be informed.

Rules engines are can process large numbers of rules against a given data set in order to come to a single conclusion. Very complex logic can be built up by combining large numbers of rules which individually can be quite simple. Rules can be independent of each other and new rules can be added over time. The rules engine will deal with the task of combining the rules.

A business process that is mostly automated may be modelled in BPEL and defer to the workflow system in order to have manual tasks completed. However, if there is little automation in the business process, it may be more appropriate to model this in a workflow system and have the workflow system invoke on the BPEL processes for automated tasks. In both cases, leaving the evaluation of complex logic to a rules engine is a good idea.

Having each of these systems communicate with each other using peer-to-peer Web service interfaces provides the most flexibility and avoids any proprietary extensions or unnecessary dependencies between systems. It also means that a task performed manually could in the future be automated without the need to modify the interface.

A couple of recent demos were posted on developer which you can combine in order to see BPEL orchestration, business rules and human interaction working together.
Assigning tasks to people as part of a BPEL orchestration is a variation on the classic loan approval sample and shows how the task of manually approving the loan can be easily performed by a human. You can then add rules into the mix by taking the Web service provided in Exposing JBoss Rules (Drools) via a Java Web Service and deploying it to the same server.