Posts tagged business rule

Difficulties with a more complex Business Rule Engine in Oracle SOA Suite

In my previous post I’ve shown how to create a composite in the Oracle SOA Suite with a simple decision table in a Business Rule Engine component. For that post I had used quite a simple data model resulting in a small xml/xsd tree. For our project I wanted to repeat the exercise with the real data model, so a larger xml tree defined by multiple imported xsd files. Unfortunately it wasn’t as easy as I hoped for. In this second blog post about the Business Rule Engine I’ll show you about the difficulties I had and how I’ve solved them. Read the rest of this entry »

Cookbook creating Business Rule Engine with a simple Decision Table in Oracle SOA Suite

For educational purposes I’ve created a cookbook in powerpoint format on how to create a simple decision table in Oracle SOA Suite with a Business Rule engine.
To share this I’ve uploaded it to slideshare and post it here in the Amis blog as well. Read the rest of this entry »

Manage Agility through Manage-ability – Introducing Design Time at Run Time in Oracle Fusion Middleware

Below is my presentation from the OGH DBA, SOA & BPM Day on November 8th. My talk was about achieving instant agility with application, through the ability to manipulate behavior and look & feel of applications at run time. And also to provide various flavors – parallel versions – of the application through customization.

Oracle Fusion Middleware has built-in infrastructure to provide run time agility as well as customization. This infrastructure is commonly referred to as ‘design time at run time’ (and lately also the Fusion Extension Platform). It is based on MDS (meta data services) Repository and a bunch of run time, WYSIWYG tools: the composers.

To make agility work through design time at run time, it is adamant that organizations clearly define the roles and the process associated with it. And finding staff to play the role of ‘run time application editor’ will not be easy.

Manage Agility through Manage-ability – Introducing Design Time at Run Time in Oracle Fusion Middleware

Business Rule: Only One per Day, but keep the time

The business rule states:

Only one entry is allowed per ID and per day and the time should be recorded.

The table involved (simplified for the blog post)

SQL> create table test
  2  (id         number
  3  ,inspection_dt date
  4  );

Wouldn’t it be nice if it was possible to do it like this?

SQL> create table test
  2  (id         number
  3  ,inspection_dt date
  4  ,constraint one_per_day unique (id, trunc (inspection_dt))
  5  );
,constraint one_per_day unique (id, trunc (inspection_dt))
                                    *
ERROR at line 4:
ORA-00904: : invalid identifier

This way you still have the complete date information (time is a component of the date column), and only use the TRUNC (inspection_dt) to constrain the data entry.
As you can tell from the error message, this is not allowed.
Oracle 11g Release 1 introduced Virtual Columns which can implement this requirement declaratively.

Read the rest of this entry »

Implementation of a moderately complex data constraint business rule using RuleGen 3.0

In a previous article, I have introduced RuleGen 3.0 – a 2nd generation business rule implementation framework for the Oracle Database: http://technology.amis.nl/blog/?p=12807. RuleGen provides a solid, structured, scalable framework for database developers to implement data constraints in. This article demonstrates how a moderately complex rule is analyzed and designed and implemented with RuleGen 3.0. If you want to try out RuleGen yourself, you can download the framework under trial conditions from http://www.rulegen.com/free-download .

This article illustrates the essential steps in the business rule design and build process:

  • describe the business in human readable format – preferably using names of entities and attributes or even better tables and columns
  • analyze the events that potentially violate the business rule and should therefore trigger evaluation of the rule
  • define the filter condition (a SQL expression) that identifies the records that should be checked for each triggering event (typically only a very small subset of the records in a table need to be explicitly validated upon an event)
  • define the rule validation logic in terms of SQL – write the SQL query that should not return any records in order for the rule to be valid
  • record the events, the filter conditions and the validation SQL in the RuleGen design time UI
  • configure additional characteristics of the rule – such as validation time (statement or transaction), enabled status and log-setting
  • generate the rule implementation code and deploy the rule to the run time environment

note that these steps only involve a minimum of programming: typically two or three relatively simple SQL queries. No PL/SQL programming is involved. No additional tools (besides the APEX UI of RuleGen or its APIs) are required.

The rule that I will implement in this article is specified in the context of a familiar data model – see the figure below:

Image

The rule that needs to be enforced is: “Employees who are a SALESREP should not work for a department that is located in Amsterdam”. We will not be discussing the business meaning of this rule in this article – we take this rule as the outcome of careful analysis of our business. Our responsibility is to ensure that no data will enter our enterprise database that does not comply with this rule.

Read the rest of this entry »

RuleGen 3.0 – the latest, leanest and most robust solution for complex data constraints in an Oracle Database

No matter how complex the enterprise and application architectures become, no matter the number of tiers, services, devices and user interfaces – at the heart of most enterprises will be a relational database.

Image

And no matter how hard we try to implement a fully service based architecture or a multi-purpose business tier (for example using EJBs) – we will have multiple routes to the database and the data in it. Data will be manipulated through web applications, web services, client/server applications, batch database jobs, application managers working directly against the database from the command line or TOAD-like tools. If for no other reason – that by itself is an overridding motivation for enforcing every data constraint at the lowest possible level – the one level that none of these channels can avoid: the database itself. In addition to the fact that only enforcement inside the database can provide real integrity (and what the hack would be semi-real integrity?), for most data rules (especially complex ones) implementation inside the database is the most performant, scalable, maintainable, managable, agile, elegant and easy to implement as well.

Note: I am not advocating that data rules should not be implemented in other tiers as well. For the purpose of user friendliness through quick feedback and preventing incorrect data from ever getting near the database, it is of course perfectly fine to specify required fields, fields with a certainly length or a domain with allowable values in user interfaces and/or describe and enforce data constraints in the POJO Domain Model and the XSDs for the canonical data model of the ESB. However: all of these are only supplemental. They do not provide robustness.

Implementing data rules inside the database is not trivial, despite all the clear advantages outlined above.

Read the rest of this entry »

Book review of: Getting Started With Oracle SOA Suite 11g R1: A Hands-On Tutorial

Getting Started With Oracle SOA Suite 11g R1: A Hands-On Tutorial

Authors: Demed L’Her, Heidi Buelow, Jayaram Kasi, Manas Deb, Prasen Palvankar (aka Oracle Product Management for SOA Suite)

A hands-on tutorial is what the cover of the book promises, and that is exactly what you get. A quick, very hands-on introduction into the most important components in the SOA Suite 11g. In no time at all, readers will be able to get a composite application up and running. An application that leverages many of the essential features and functions in the SOA Suite.

Some books are primarily an introduction into a certain topic, with lots of theory, background and explanations of what, why and how. Other books are mainly reference material that you use to look things up when you need them. This book is neither – it offers very little in the way of explanation and background and it would be fairly useless as reference guide. It is however a very good way to get to know the SOA Suite – both design time and run time – and get a feel for how to develop for it and run applications in it.

The book contains a large number of informative screenshots and also provides the salient code snippets. It is very focused on getting specific jobs done, and for these jobs it has all the information and illustrations you may need. It is hard to not get it to work following the very detailed instructions.

The book – or at least the paper copy I am holding – is written for the very first 11gR1 release, that was published on July 1st 2009. The functions made available with PS1 release (November 2009) are not discussed therefore.

Read the rest of this entry »