Академический Документы
Профессиональный Документы
Культура Документы
plus(BRFplus/BRF+)
Agenda
What are Business Rules ?
Conventional Methods
Business Rule Management
How it began
Releases
Features of BRFplus
Rules Creation Process
Execution Process
Sample Application
What are Business Rules ?
Conventional Methods
Business Rules Management & its benefits
Ubiquitous Business Rules
How it began ?
Started development project to investigate the usage business rules for the new technology under the code name Vienna - now its
BusinessByDesign
Importance of the business rules and the advantage of highly flexible and code-free customization began the development of a
general purpose BRMS what is known today as Business Rule Framework plus(BRFplus)
Working title of the BRFplus was Formula&Derivation Tool(FDT)
The following list contains the important tools and engines at that point in time:
Business Rules Framework (BRF)
Condition Technique
Costing Formula Builder
Derivation Tool (and clones)
Formula Builder (Fobu)
Hierarchical Derivation Service (HDS )
Internet Pricing and Configurator (IPC )
Rule Modeler
Validation, Substitutes, Rules (VSR)
Workflow Rules
BRF was developed for the insurance solution but it had its own restriction later BRFplus came into picture for more generic usage
with added capabilities.
BRFplus is integrated perfectly with the ABAP stack and supported ABAP-based applications in the best possible way.
It preserved the functionality of all the existing tools
Releases
BRFplus was first shipped in SAP Netweaver 7.0. This shipment included only few pieces of the infrastructure and had no
user interface. It served some pilot customers but was never intended to be used on a large scale. Since then, many
incompatible changes were introduced. Therefore highly discourage to use BRFplus in that release.
Next shipment was with SAP Netweaver 7.0 EHP1. The basic infrastructure could be completed and a UI was provided. But
still, there were quite some limitations, such as missing features, poor usability, and stability of some components. Simple
scenarios can be supported by this version, using functions, data objects and the expression types Decision Table, Formula,
and Case. For more complex scenarios, the recommendation is to use BRF and consider a migration to BRFplus as soon as
SAP NetWeaver 7.0 EHP2 is available.
Complete shipment was with SAP NetWeaver 7.0 EHP2 . It can be used for use cases of any degree of complexity. Based on
this release, the migration pilot projects have been completed and are shipped as part of SAP ERP 6.0 Enhancement Package
5.
The pilot projects are:
Tax and Revenue Management
Social Case Management
Social Application Processing
Social Service Plan Processing
Deduction Plan Processing
From this release on, the recommendation is not to use BRF for new projects anymore but to use BRFplus instead.
Features - BRFplus
Rules Authoring
Developed on Webdynpro ABAP technology
No installation is required as it runs on browser
Is embedded in the Application UIs(SAP SRM) or used standalone.
Fully support data dictionary.
Simulation tool allows the business users to test rules before releasing them.
Additional tools and views are available for the tracking of changes, consistency checks , dependency analysis, XML and MS Excel to
name a few.
Rules Engine
Specific rule entities can be accessed and processed with jus a few lines of ABAP code
Generated Webservices and RFC enabled function modules can be used for remote invocation
Incorporates code generation framework for best performance.
Concept of time travelling: Rules can be processed for a specific timestamp so that the definitions that were valid at the specific
point in time are applied.
Rules Repository
Rules can be stored client dependent or client independent as system, customizing and master/application data
Connected to SAP Change and Transport System(CTS)
Data exchange via XML export and import supported
Authorization concepts
Versioning to allow tracking of changes or time dependent rules processing.
Prerequisites
Role
SAP_BC_FDT_ADMINISTRATOR
WD Configuration
/sap/bc/webdynpro/sap/fdt_wd_workbench
/sap/bc/webdynpro/sap/fdt_wd_object_manager
/sap/bc/webdynpro/sap/fdt_wd_catalog_browser
Rules Creation Process
Terminology
Application - Container for all kinds of different BRFplus objects . All BRFplus objects are assigned to exactly one
application . It imposes some common technical settings such as development package, software component and
application component. The application component and software component have to be the same as defined for
the development package. The application and software component are automatically derived from the
development package if they are not set.
There are three types of applications Customizing application, Master Data application, and System
application. Customizing and System applications can be local, but Master Data application is always
local. All three types of application can be assigned to a development package. The type of application
can be set when a new application is created.
Data Objects - A data object behaves like a variable in a programming language . Data carrier in the context
or as storage for the result of an expression or action . Data objects can be of element type, structure
type or table type.
Expression Types - Defines a self-contained computational unit with a well-defined logic. BRFplus comes with
a set of common expression types and will be continuously enhanced by new expression types. You can
create your own expression types and use them in rules.
Types of Expression
BRMS Connector The BRMS connector enables one to use the SAP NetWeaver
BRM or any other external rules engine with BRFplus.
Decision Table The decision table expression sequentially processes rows of a
table that consists of condition and result columns. If all
conditions in a row are met, the corresponding result values
are returned. The decision table can work in two modes: single
match and multiple match modes.
In the single match mode, the decision table stops processing
at the first matching row, thus returning a single result.
In the multiple match mode, all rows are processed and the
results of all matching rows are collected into a table.
Formula The formula expression allows you to perform a wide range of
mathematical, boolean and other kind of calculations. It can
use any other expression or context data objects to determine
the result.
Function Call It allows to call the function. This makes the function
resuable.They may be a part of another application in that case
access levels to be considered.
Rule A rule consists of a condition and two actions, true action and
false action. If the result of the expression is true then the true
action is processed. If the result of the expression is false then
the false action is processed.
A rule checks a condition and fires an action depending on the
result. The condition can be a context data object or an
expression that provides a boolean result value.
XSL Transformation This expression performs an XSL transformation to determine a
result. A list of parameters (context data object or nested
expression) is passed to the XSL transformation as input. The
transformation can either be referenced by name (the
transformation has to exist in the system) or it can be derived
from a nested expression or context data object value.
Expressions access context data objects and may nest other expressions to calculate or determine a result. They are the
building blocks for rule and function as definitions.
Terminology
Actions - Actions are expressions of an action type .
Action Types - Action types are special expression types that define the interactive part of BRFplus . Action types do
not have any output. Instead, they define some result-independent processing, based on incoming data. Since
action types are highly application-dependent, BRFplus provides only a few generic ones.
Types of Action
Static Method Call The static method call action takes a class
which implements a special interface and calls
a specific static method at runtime. To
determine a result, the method can access the
context and an optional set of (sub)
expressions.
Terminology
Ruleset - A ruleset handles the processing for a collection of rules. A rule in a ruleset can be enabled or disabled in
general. Its validity can also be restricted to a certain time period .
Execution Process
Sample Application
1. Set up a sample application, Function and Ruleset.
2. Derives the price of some product
3. Add shipping costs of 5%, but at least 2$, if the price
is under 100$.
4. Send a notification mail if a product is not found in
the price list.
5. Finally we test the application
1. Create an Application, Function, and
Ruleset - 1
Call the BRFplus Workbench
Call transaction BRFPLUS/BRF+
Click Workbench Personalize and select Show in Change Mode as Viewing Mode. Then click Save. By doing so, you do not need to
change to edit mode in every single screen
Call transaction BRFPLUS again for the changes to become effective (you can do so by refreshing the browser page). This will always
makes you to view in editable mode
1. Create an Application, Function, and
Ruleset - 2
Create a new Application
Click Workbench Create Application
Enter Name, Short Text, and Text, e.g. <your name> (you can use the same for all three fields, if the text is short enough).
Check Create Local Application.
Click Create and Navigate to Object.
Click Activate and confirm the popup window with Activate.
1. Create an Application, Function, and Ruleset - 3
Click Create and Navigate to Object and confirm the popup window with Yes to save your input
Select tab Domain Values
Click Create Value
Enter Name, Short Text, Text, and Value, e.g. Tennis Racket and click Create
Repeat that previous step for some more
products
Click Back and confirm the popup
window with Yes to get back to your
function
1. Create an Application, Function, and Ruleset - 6
Click Save
You have now created the framework of your business rule. What is left is to create the actual rules themselves in the
following exercises
2. Define a Simple Rule
Click Create and Navigate to Object and confirm the popup window with Yes
Click Return an initial value if no match is found
Click the icon right of Result Data Object and select PRICE (the name of the data element of type Amount that you created
earlier) and confirm the popup window with Yes
2. Define a Simple Rule - 3
Repeat the last five steps (from Click Insert New Row) for several products. Also include at least one product more than
once with different prices
Note: you can set the Table Check Settings to not allow for duplicates. In this case we want to allow duplicates. So later we
can observe that only the first match is considered
Click Back and confirm the popup window with Yes (now the ruleset you created before should be selected)
2. Define a Simple Rule - 5
Add other Rules to the existing Ruleset using Formulas and Actions
At the right side of the rule we already created click Other Operations Insert Next Rule by Create
Click Enable Rule
Enter a description, e.g. Add Shipping Costs
At the If branch click on No Condition Assigned. Assign Condition Use Value Range From PRICE
3.Define more Complex Rules - 2
By using context elements, operators, and formula functions offered at the lower part of the screen enter the formula
PRICE + IF ( PRICE >= 100_USD , 0_USD , MAX ( 2_USD , PRICE * 0.05 ) )
Click the Check button to make sure that the formula is syntactically correct
Click Back and confirm the popup window with Yes
3.Define more Complex Rules - 5
At the Recipient(s) field enter an arbitrary email address (we are not going to actually send the mail. So it does not matter,
whether the address is valid or not)
3.Define more Complex Rules - 8
On the upper left of the screen you should see a success message Object(s) activated and all objects you created should
show a green icon in the repository tree, indicating they are active
If there still are inactive objects, select them in the repository tree and click Activate
Click Show also Results of Intermediate Steps (radio button at the bottom of the screen)
Enter a product (you can select products you created before by clicking on the icon right of the input field)
Click Run Simulation
4.Run the Rules - 4