Let’s put ourserlves in the next scenario, we are owners of a franchise and we have two stores. These stores sell different kind of products. We are planning to give a monetary award to the store that exceeds the Sales Record of u$s 1000. So, How shall we do it???…. You are right, with Drools Fusion.
Our project will be implemented using Maven and in the pom.xml we should add the next Dependencies:
The Sales will be our EVENTS, we don`t know when they are going to happen but they certainly will. Considering this, the next thing to do is create our Sale Class (POJO) and declare it in our DRL File as an Event.
Finally let’s create our Drools Session and insert the events in the suitable entry-point of the WorkingMemory(Session).
After running the java application, you should see that the StoreOne is the winner.
-An Event is a Fact with a TimeStamp.
-EntryPoints allow us to classify the Events, so we can only get matching events from an specific entry-point.
-Entry points are declared implicitly in Drools by directly making use of them in rules.