Bindings, Platforms, and Innovation
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
Tracking change and innovation in the enterprise software development community
.jpg)
Posted by Boris Lublinsky and Didier Le Tien on Mar 12, 2007 01:00 PM
One of the main drivers for using of the Service Oriented Architecture (SOA) is to increase enterprise agility and minimize the impact of inevitable changes. This is typically achieved through separating the implementation artifacts that change often from the ones that are fairly stable. Common techniques to support such separation are decomposition and encapsulation. In the case of SOA decomposition leads to the definition of services, representing more stable artifacts, and business processes, representing more fluid ones [1]. In a typical SOA implementations, services do not change often, but are composed and recomposed fairly often to build/modify enterprise solutions.
Agile Development: A Manager's Roadmap for Success
Business Benefits of Open Source SOA
Comprehensive Threat Protection for REST, SOA, and Web 2.0 Applications
Such decomposition does not directly address the positioning of the business rules - another frequently changing component of the overall IT implementation. Based on the fact that business rules can change fairly often, one of the widely adopted practices is associating them with the business processes - more frequently changing SOA components. The popularity of such an approach is additionally backed by the fact that many practitioners consider business rules as part of the broader business process management (BPM) picture and tend to bundle business rules and business processes together 1. As a result many consider business rules engines and business process engines as two competing technologies for business processes/business rules implementation. This is based on the following popular misconceptions:
In this article we will outline commonalities and differences between business rules and business processes and present some guidelines on positioning business rules in SOA implementation and appropriate usage of each technology.
"Business rules describe the operations, definitions and constraints that apply to an organization in achieving its goals. These rules are used to help the organization to better achieve goals, communicate among principals and agents, communicate between the organization and interested third parties, demonstrate fulfillment of legal obligations, operate more efficiently, automate operations, perform analysis on current practices, etc" [2]. Business rules can be viewed as a collection of business practices, defining the actual implementations - business logic. Implementation of such logic can often be simplified through the usage of specialized tooling - business rules languages and business rules engines.
A rules language is a domain specific language, containing constructs for defining of the business rules. These constructs can vary greatly depending on the business requirements. The scope of possibility ranges from a textual description (using a rule specific language or plain English) to the use of decision tables or decision trees. In some cases, it is also possible to graphically determine the sequence of execution of those business rules using a rule flow. The last one is often the cause of the confusion between business processes and business rules. Although they look similar, business process flows are defining the execution sequence of services which may run across many different and heterogeneous systems. On the other hand, business rule flows are limited to the orchestration of the rules execution sequence.
Sidebar. Domain Specific Programming Languages
"A domain-specific programming language (DSL) is a programming language designed to be useful for a specific set of tasks. This is in contrast to general-purpose programming language (GPL), such as C, Java, C#, etc."[3]. DSLs are typically tailored specifically to a specific problem domain. As a result it captures precisely the domain's semantics. In order to further simplify their usage, DSLs are usually highly declarative and describe what needs to happen, rather then how it is done (the latter is responsibility of the language implementer). Because of this, DSLs often are considered (executable) specification, not programming languages.
The key advantages of a specific DSL are domain specific abstractions and notations as well a restricted (or rather focused) expressive power. There are several reasons that make DSLs more attractive than GPLs for some classes of applications [4]:
Easier programmingBecause it is uses a higher level of abstraction, which is well aligned with a problem domain and defines what to implement, rather then how to do it, a DSL program is generally more precise (due to its alignment with the domain) and easier to implement and understand (not only by developers, but also by domain experts) compared to GPL implementation. This typically leads to a shorter development time and less expensive maintenance. Additionally DSLs are coming with high level debagging support, allowing for to analyzing and debugging code directly on the domain concepts level.
Systematic re-useReuse was always one of the ways of improving implementation of new applications and shortening development cycle. Although GPLs promote reuse through usage of standard and domain - specific libraries, their actual usage is left to the developer. DSLs, on the other hand, enforce reuse of the libraries that are utilized by the DSL implementation. Additionally, because DSLs are defined for particular problem domains, they capture and consequently reuse specific domain knowledge.
Easier verificationWith advances in software engineering, formal code verification is playing an important role in successful development. While in the case of GPL, such verification only ensures that the code will execute, in the case of DSLs, due to their compactness and domain alignment, validation can often ensure that the code will produce correct results.
Increased cooperationThe use of the same business related semantics across the organization facilitates the sharing of the information and reduces the risk of mismatch between the business logic actual implementation and the business users' expectations.
Business rules engines support evaluation of rules expressed in a corresponding rules language. Their main functionality is to manage a collection of facts and to evaluate rule sets comprised of one of several predicates. Dealing with large numbers of facts and efficiently evaluating predicates is one of the key challenges of rule evaluation.
Based on the business rules definitions, expressed in the business rules language, business rules engines typically provide some mapping mechanism to generate lower level execution code - usually general purpose language classes. Those classes can be used as a partial implementation of a larger business component. An immediate consequence of such an approach is that the business rules' implementation lifecycle is aligned with the lifecycle of the business component to which they belong to.
Flexibility and modifiability of business rules implementations is achieved through the rules maintenance support enabling dynamic changes (using the original rules language). Such ability provides a convenient way to dynamically modify business rules without rebuilding and redeploying implementation to quickly adapt to changing business environments.
Declarative programming (i.e., prescribing the what) represents the paradigm of choice for rules: something gets triggered (i.e., an action) based on whether a rule evaluates to true or false. The control flow (i.e., the sequencing of these invocations) is implicit and emerges as the rules fire off.
"A business process is a set of linked activities that create value by transforming an input into a more valuable output. Both input and output can be artifacts and/or information and the transformation can be performed by human actors, machines, or both" [5]. Activities comprising a business process do not include any process-level decision making and are not worth further decomposing 2.A business process definition can be viewed as a recipe for achieving a specific goal. Similar to the case of business rules, implementation of business processes can be significantly simplified using business processes DSLs and specialized business process engines.
Business process programming requires specifying the sequence and conditions of execution of process activities (control flow) and data exchanges between activities (data flow). Typical language constructs allow for defining a process either in the form of extended flowcharts or finite state machines.
The business process definition, expressed in a business process language, is typically directly executed by a business process engine. (An engine internally can either compile or interpret the business process language. The business process engine supports coordination of process activities execution and propagation of data between them. Managing of the simultaneous execution of multiple asynchronous process instances under resource constraints is one of the key challenges of business process engines.
As a result business process implementation is separated from the implementation of activities, orchestrated by a business process. This provides capabilities of introducing changes into business process with no or minimal impact to the underlying activities, thus providing a higher level of modifiability to the overall system.
Imperative programming (i.e., prescribing the how) represents the paradigm of choice for business processes implementation: something gets invoked after something else because the business process definition prescribes their sequence. The control flow is explicit.
In order to remain competitive a company needs to constantly change and improve its business processes. Factoring business processes out of the applications and using a business process language and engine for their implementation allows the simplification of the implementation and modifiability of enterprise business processes.
Determining the right technology becomes critical when it comes to best supporting business requirements and achive the optimal architectural qualities. At the end of the day, assuming that appropriate DSL and engine are used, the implementation choice between business rules and business process paradigms depends on the two major factors:
When it comes to the capabilities of the rules vs. business process engines, the following should be considered:
As defined in [1], SOA design is based on the top down decomposition of the enterprise business model, defined as a collection of the top level business processes. In this approach (Figure 1) top level business processes define a set of activities, which constitute high-level business services. These services, in turn, are often considered to be processes, which leads to the recursive decomposition. Finally, services are implemented as a coordination of a set of components, which represent leaf elements of this decomposition.
Figure 1 Hierarchical decomposition
Different implementations of business components in this case may include "wrappers" of existing enterprise functionality 4 , new implementation using general purpose programming languages, business rules based component and orchestration based components.
Based on this decomposition approach above, the following usage of business process/rules are typically present in SOA implementations:
Finally, not reflected in this decomposition is the case of using business rules for implementation of decisions in business process execution.
Based on the above comparison of business processes/ business rules engines capabilities and SOA decomposition the following recommendations can be made for technology choice:
Service orchestration typically deals with long-running and asynchronous invocation of external activities/services. Today's business rules engines do not support these capabilities. Business process language/engine, designed specifically to define and execute long-running coordinations with asynchronous invocations is the most appropriate paradigm for the service orchestration.
When it comes to implementation of business components a case of short - lived transactional implementations with only synchronous interactions - the line between business rules/business processes becomes blurry. Often the same problem can be defined and consequently solved with either technology.
Let's consider the example of claim handling charge calculation 5.The claim can be either subject to the flat handling charge, or loss conversion factor (LCF). In the first case the flat charge can apply to either claim as a whole or each suffix of the claim separately. The combination of these different options creates three distinct claim handling charge calculation rules. This rules set can be represented either as a set of rules (Figure 2) or as a process (Figure 3).

Figure 2 Representation of claim handling charge calculation using rules

Figure 3 Representation of claim handling charge calculation using process
As a result, based on the design-time paradigm, one might consider using either a rule set or a business process approach for solving the same problem.
In the case when rules define the execution of business process itself, it is necessary to consider their complexity and change frequency.
Modern business process engines usually provide capabilities for evaluating simple rules, either built in the business process language or by invocation of general purpose languages. Thus it is entirely feasible to implement "simple" business rules in the business process engine. In this case however, any change in the rules will require a full testing and deployment of the business process. As for complex business rules, they typically need to be extracted from the process and implemented as a separate service, using a rules engine.
Another typical scenario is the one when the business process itself (process structure) is fairly stable, but the rules, governing activity transitions, although fairly simple, can change fairly often (see Figure 4). In this case externalizing rules implementation as separate services, implemented using a rules engine can significantly improve overall solution maintainability. The ability of business rules to support dynamic changes in business rules, allow, in this case, to modify business process implementation without changing and redeploying it.

Figure 4 Typical change of rate for services, processes and rules
Figure 5 shows typical usage of business process and rules engines in the SOA implementation.

Figure 5 Typical usage of business process and rules engines in SOA
As we can see from the figure above a prevalent pattern in SOA implementation is employment of rules engine as part of service implementation and the use of business process engines for service orchestration. In cases when rules control activities whose coordination is complex enough, or change much faster the process itself, so that they require usage of the rules engines, these rules are usually externalized as a special rules service, invoked by business process engine. Because this service invocation can be potentially expensive (network calls) some of the business process engines, for example Biztalk 2004 from Microsoft, WebSphere Process Server from IBM, Smart BPM Suite from PegaSystems and others incorporate both business process and rules engine in a single application.
Business process and business rules should not be treated as competing but rather as complementary technologies. Business processes define a set of activities that need to be performed in order to perform a business functions. Business rules provide a value add approach to implement those activities by offering a superior level of flexibility and configurability to adapt to rapidly changing business environments.
Would you enroll in an India Forex Group i.e http://www.indiaforex.com Groups?
I agree, that it is important to separate processes from the rules. In addition, the separation of processes from the services is important. I think the basic idea of describing business is to start with business capabilities, which are the most stable parts of the business (see Homann et al). The capabilities (or groups of them) then form services. The business process is one (possible) implementation of a capability. Basically, if considering non-manufacturing enterprises (e.G. research lab) the formalization of the business process is not possible.
In other words, there is a semantic gap between services which are stable and result from direct decomposition of unstable (changing) business processes...
The article mentions that today's business rules engines do not support the Service orchestration typically deals with long-running and asynchronous invocation of external activities/services. I have been using EAI technologies that provide such capabilities for almost 7 years now. What engines are you referring to?
Hi Abdu, We are referring to engine like Blaze for example. Best, Didier
I think there is a link from business process to business rule that is missing here - business decisions. The separation of business rules from business processes should be driven not just by their complexity or volatility but by there support for business decisions. It is not helpful to have the rules for real business decisions (is this customer a good risk, what's the right cross-sell here, what preventive maintenance is called for now) embedded in processes. Managing decisions is as important as managing processes, if not more so, and that's where business rules management systems thrive. I blogged about this - Business Rules, Business Decisions, Intelligent Processeses, Enterprise Decision Management(there a number of analyst reports, articles and blog posts linked inside the main post)
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.
This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.
This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.
This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.
After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.
IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.
Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.
4 comments
Watch Thread Reply