A very successful pattern for business applications is the separation of business processes and objects from business rules. The latter can be implemented in business rules framework like BRFplus which is the state-of-the-art technology of the ABAP application server. In the following I will discuss two different architectural patterns for applications using business rules and I will give you my opinion about the biggest strength of using BRFplus: it allows simulation of execution of business. Please remark that I don’t speak of the simulation of a single BRFplus rule using the BRFplus workbench – I speak of performing the calculation of changed business rule by calculation perhaps millions of calculations in batch processes to estimate the consequences of changes in your ERP system. And last but not least I will muse about the connection about business rules and business processes.
Before going into detail I will have to explain some basics of BRFplus. BRFplus functions, which are the interface of ABAP applications and business rules, can be action-based or function-based. But what does the mean? Let me cite SAP library when it explains so called BRF functions which are the interface of ABAP code and a business rule:
A function can be designed for one of the following modes of operation:
If you are interested in this topic I recommend a look at SAP Library. But please let me summarize:
In fact in this blog I will discuss actions and ways to use them properly but before going into detail I’ll discuss an important best practice for rule based systems.
In the following I would like to give you an advice: use event mode only. The reason is that in the event mode you can use rules and rule sets which is quite flexible since rules can have preconditions and can be grouped to rule sets where in functional mode you have only a single expression. This has quite a few benefits:
So the event mode will give you access to the central element of BRFplus where functional mode is only useful for single computations using expressions. Of course you can start a BRFplus project using functions in functional mode but if requirements get bigger (rules face reality and are getting more complex or software logistic must be more flexible) you will have to switch to functions in event mode.
You can use BRFplus (either in functional mode or event mode) as computation engine. The rule machine computes calculations, automatic approval or rejections or performs fraud detections for example.
For me this is the best use case for BRFplus because the separation of application logic and Business Rules. If the execution of business rules is a functional (although in event mode) you can call them without any side effect. This makes it possible to copy the rules, change them and look at the results by processing already processed cases and look at the results. Please remark again that I don’t speak of the simulation of a single BRFplus rule using the BRFplus workbench – I speak of performing the calculation of changed business rule by calculation perhaps millions of calcutions in batch processes to estimate changes in your ERP system. This is really useful, just think at the following examples:
In my opinion we have to design business applications in a way that we can perform simulations. This is extremely important for data driven systems (think of banking or insurance solutions where nearly all business objects are processed automatically. I expect that data driven systems will become more and more ubiquitous if processes from mobile systems reach the backend systems.
The capability for simulation makes an ERP/CRM application more transparent because experts will be able to answer questions what would probably happen after changing business rules. This transparency leads to agility because it can reduce risks when changing business rule and make it even possible to change business processes.
But back to BRFplus: functions in event mode can trigger actions which can be used to start processes in the ABAP application. These can be calls of function modules, the start of workflows, sending emails and creation of message logs which are accessible as protocols of the Business Application Log.
I use the mechanism of creating logs very often and read those logs from the memory and use them in the same way like computations of functions.
But actions are far more powerful and can be used to implement side-effects to rules think of sending eMails to certain users like power users. This can lead to an architecture where BRFplus works like a process engine: BRFplus performs a calculation and then takes over the control of the process flow by starting workflows. It can even throw asynchronous workflow events and change the status of business objects and even running workflows.
Personally I’m a little bit suspicious about these features: at first we separated business rules from business processes and now we are doing just the opposite. You may think of these concerns as a theoretical issue but it has immediate consequences:
But the biggest problem is in my opinion that performing BRFplus functions with side effects can lead to an architecture where simulation is no longer possible. In my opinion you should try to separate BRFplus computations and actions so that still a meaningful simulation of a changed business rule is possible even if you omit the actions while performing a ROLLBACK WORK in a simulation process.
When starting to create rule based applications you should consider the following:
This blog entry covered the last aspect: you can use BRFplus as computation engine and as process engine and within SAP standard software you will find implementations for both architectural patterns. Both patterns have their strengths and weaknesses and you be aware of them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
11 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
3 |