2. Drools : Drools is a Business Rules Management System (BRMS) solution. It provides a core Business Rules
Engine (BRE).
Drools supports the JSR-94 standard for its business rule engine and enterprise framework for the
construction, maintenance, and enforcement of business policies in an organization, application, or service.
3.
4. Mule have Drools component to execute business rules in it’s application
5. Now, let us create a simple application in our Anypoint studio. This application we will be
deploying and running in our Mule Standalone Server and will be using Business rules in our
Mule application using Drools
6. We need to keep a .drl files in our application where all the business rules will be
defined .. In our case all the business rules are in this routingRules.drl file:-
7. Rules in the routingRules.drl are defined as follows:-
You can see the rules that if weight variable value is less than or equal to 50 then WAREHOUSE_B will b
as printed as destination or else WAREHOUSE_A will be printed
8. You can see Mule code that the variable weight is generated randomly and the value of the weight is
been checked by the Drools component which is referring routingRules.drl where all the rules are set :-
9. You can see the value in weight variable is generated randomly and the destination
value is set to WAREHOUSE_B as defined in .drl file
Now we test our application by hitting http://localhost:8082/example and we will get
the following:-
10. You can see the value in weight variable is again generated randomly and the
destination value is set to WAREHOUSE_A as the weight value is greater than 50 and
the rules are defined in .drl file
Now we hit the url http://localhost:8082/example again and we will get the
following:-
11. In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow