Flow Rulesets: Take Control Over Your Rule’s Execution Sequence

  • by Dr. Volker Stiehl, Professor, Ingolstadt Technical University of Applied Sciences
  • November 16, 2010
With the introduction of SAP NetWeaver Business Rules Management (SAP NetWeaver BRM) as part of SAP NetWeaver Composition Environment (SAP NetWeaver CE), you can increase your flexibility by externalizing frequently changing rules into a rules management system. See how you can use flow rulesets to manage your rules.
Key Concept
Business rules management systems allow business experts to set up and manage rules. Often systems execute rules by using the Rete algorithm, which evaluates the conditions of if-then rules and optimizes their execution sequence. The calculated sequence is not predictable and can make it difficult to analyze how a certain result was actually achieved. Flow rulesets are an alternative to Rete-based rulesets and allow the rule modeler to precisely define the rule’s execution sequence. SAP NetWeaver Business Rules Management (SAP NetWeaver BRM) supports both models.

SAP NetWeaver Business Rules Management supports two kinds of rulesets: Rete-based rulesets and flow rulesets. Each ruleset uses a different execution engine.

I discussed the inner workings of the engine handling Rete-based rulesets in my SAP Professional Journal articles “SAP NetWeaver Business Rules Management: Externalize Critical Business Logic for Enhanced Flexibility” and “SAP NetWeaver Business Rules Management: Tips for Testing and Working with Business Rules.” In those articles, one big problem I encountered as I went through an example for calculating a buyer’s discount was the determination of the rule’s execution sequence when several rules are ready to fire and all of them have the same priority. Rete optimizes the execution sequence taking into account several aspects, such as the rule’s creation timestamp. As a result, identical rulesets deliver different results.

I explained how to solve the conflict by using either priorities or overrides. Both mechanisms allow you to achieve more predictable results. However, sometimes you might want to define the execution sequence yourself. You don’t want to rely on the optimizations done by the Rete algorithm. You want to take control and be responsible for the order in which the system calls the rules.

The solution: use flow rulesets. Flow rulesets allow you to define the exact rule call sequence graphically. I will first take the example from the first article and solve it using a flow ruleset. In a second, more complex example, I will show you how to embed decision tables and rule scripts in your rule flow to help you solve even more complex problems quite elegantly.

Dr. Volker Stiehl

Prof. Dr. Volker Stiehl studied computer science at the Friedrich-Alexander-University of Erlangen-Nuremberg. After 12 years as a developer and senior system architect at Siemens, he joined SAP in 2004. As chief product expert, Volker was responsible for the success of the products SAP Process Orchestration, SAP Process Integration, and SAP HANA Cloud Integration (now SAP HANA Cloud Platform, integration service). He left SAP in 2016 and accepted a position as professor at the Ingolstadt Technical University of Applied Sciences where he is currently teaching business information systems. In September 2011, Volker received his Ph.D. degree from the University of Technology Darmstadt. His thesis was on the systematic design and implementation of applications using BPMN. Volker is also the author of Process-Driven Applications with BPMN as well as the co-author of SAP HANA Cloud Integration and a regular speaker at various national and international conferences.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.