Book Image

JBoss Drools Business Rules

By : Paul Browne
Book Image

JBoss Drools Business Rules

By: Paul Browne

Overview of this book

<p>In business, a lot of actions are trigged by rules: "Order more ice cream when the stock is below 100 units and temperature is above 25&deg; C", "Approve credit card application when the credit background check is OK, past relationship with the customer is profitable, and identity is confirmed", and so on. Traditional computer programming languages make it difficult to translate this "natural language" into a software program. But JBoss Rules (also known as Drools) enables anybody with basic IT skills and an understanding of the business to turn statements such as these into running computer code.<br /><br />This book will teach you to specify business rules using JBoss Drools, and then put them into action in your business. You will be able to create rules that trigger actions and decisions, based on data that comes from a variety of sources and departments right across your business. Regardless of the size of your business, you can make your processes more effective and manageable by adopting JBoss Rules.<br /><br />Banks use business rules to process your mortgage (home loan) application, and to manage the process through each step (initial indication of amount available, actual application, approval of the total according to strict rules regarding the amount of income, house value, previous repayment record, swapping title deeds, and so on).<br /><br />Countries such as Australia apply business rules to visa applications (when you want to go and live there)&mdash;you get points for your age, whether you have a degree or masters, your occupation, any family members in the country, and a variety of other factors.<br /><br />Supermarkets apply business rules to what stock they should have on their shelves and where&mdash;this depends upon analyzing factors such as how much shelf space there is, what location the supermarket is in, what people have bought the week before, the weather forecast for next week (for example, ice cream in hot weather), and what discounts the manufacturers are giving.<br /><br />This book shows how you can use similar rules and processes in your business or organization. It begins with a detailed, clear explanation of business rules and how JBoss Rules supports them.<br /><br />You will then see how to install and get to grips with the essential software required to use JBoss Rules. Once you have mastered the basic tools, you will learn how to build practical and effective of the business rule systems.<br /><br />The book provides clear explanations of business rule jargon. You will learn how to work with Decision Tables, Domain-Specifi c Languages (DSL)s, the Guvnor and JBoss Integrated Development Environment (IDE), workflow and much more.<br /><br />By the end of the book you will know exactly how to harness the power of JBoss Rules in your business.</p>
Table of Contents (18 chapters)
JBoss Drools Business Rules
Credits
Foreword
About the author
About the reviewer
Preface
6
More rules in the JBoss IDE

Foreword

Drools was co-created by Bob McWhirter and I at Codehaus, a fantastic collaborative environment for open source development. Drools 2.0, the first official release of Drools, was a great volunteer effort from a range of people working tirelessly over evenings and weekends.

There is a long-running joke that much of Drools 2.0 was written while under the influence of beer—much to the chagrin of a CTO who was told this little anecdote just after telling us that transactions worth millions of dollars were processed with Drools 2.0.

The success of Drools 2.0 didn't go unnoticed. I was soon given the opportunity, by Marc Fleury, to work full time on Drools at Jboss—now a division of Red Hat. With the backing of JBoss, I was soon able to hire several of the key Drools community members, of Drools such as Michael Neale, Edson Tirelli, and Kris Verlaenen. Each of them has become an evil genius in his own right, making Drools what it is today. Bob is also employed at JBoss, but has since moved onto other Ruby-based endeavours.

I've known Paul for a number of years, throughout which he's been an active and valued community member. I remember the conversation two years back when Paul talked about his desire to write a Drools book. His initial goal was to write a small e-book, but I guess his ambitions and imagination got the better of him, prompting him to do something much more ambitious. So it's with great pleasure that I see Paul finally achieve this, his first Drools book. We didn't make things easy for him. Drools 5.0 was a continually changing platform during it's development cycle, on which he was trying to base this book. The main focus of this book is the web-based governance system, what other vendors call a BRMS. And luckily, most of the important aspects are here in all their glorious detail.

Previous Drools versions have challenged commercial vendors in this space, allowing people to state what they know and not have to waste time translating this knowledge into a machine-understandable format. Drools 5.0 is about to be released, and is a monumental peace of engineering over Drools 2.0, 3.0, and 4.0. It brings together rules, workflow, and event processing, along with an enterprise governance system, to form the foundations of the what I call a Business Logic Integration Platform.

I've always stated that end business users struggle to understand the differences between rules and processes, and more recently between rules and event processing. They just want to model it using some software. The traditional way of using two vendor offerings forces the business user to work with a process-oriented or rules-oriented approach. But this gets in the way, often with great confusion over which tool they should be using to model which bit. If you combine these technologies in the right way and take a behavioural modelling approach, you form something that is simpler and at the same time much more powerful. This allows the business user to work more naturally, where the full range of approaches is available to him or her, without the tools getting in the way. From being process-oriented to rule-oriented or shades of grey in the middle—whatever suits the problem being modelled at that time. We are taking this one step further and are adding event processing with Drools Fusion. Thus, we are creating a more holistic approach to software development. The term 'holistic' is used for emphasizing the importance of the whole and the interdependence of its parts.

The JBoss Drools community continues to grow at a fantastic rate and we are very lucky to get such great feedback and contributions. First-rate commercial support continues to be available from Red Hat, which helps us to continue what we are doing. Red Hat provides the branded version of Drools, JBoss Rules, which goes through additional QA and testing against the rest of the JBoss products, such as JBoss ESB and JBoss AS, and is available under long term support contracts. Thousands of sites worldwide have used Drools as a part of their solution.

So where does Drools go from 5.0? Our initial focus will now be on services and delivering codeless deployments. We will also focus on further enterprise-based governance enhancements as we continue to move up the stack from a simple embedded engine. In reality, we've only just started, and there's still much more of the vision to put into place. So all I can say is, you ain't seen nothing yet.

Mark Proctor

JBoss Rules Lead