Reputation: 688
I am starting a project where we have a lot of business rules. I have strongly been considering using the JBoss rules engine, Drools.
My project uses Scala and uses the Spark engine. I am wondering if anyone has experience, or advice, using Drools with Spark/Scala.
If you looked into Drools and decided against it, I would like to know that too.
I have read several blogs on how people integrate Drools with Spark, or Drools with Scala, but I didn't find any good examples explaining Drools on Spark with Scala. I have seen this with a mixture of Scala and Java, but never pure Scala. I am not sure if this is possible.
Update: Clarifying Question
Upvotes: 2
Views: 6753
Reputation: 513
1) Yes, I would recommend Drools. I have no experience with other rule engines, but the projects I have developed using Drools have worked perfectly so far. Truth be told, I have only used the basic functionality of Drools (never used salience explicitly, Agendas, etc). However, the functionality I have used has solved my requirements perfectly.
2) I have used Drools with both Java 7 and Scala 2.11. I haven't found any particular thing I was able to do with Java but not in Scala. My latest project is using Apache Spark with Scala and Drools, and everything fits together nicely.
If you are going to use Scala, then your facts (the objects that model your domain; aka the 'bean') should have public access modifiers on the val or var you are going to access within the rules. If you need static methods or attributes, then use Objects and import them in the rule file.
Hope this helps
Upvotes: 0
Reputation: 1986
If you looked into Drools and decided against it, I would like to know that too.
I would not advise that. We are forced to use drools in one of our components and all developers in a team find this solution full of cons:
Upvotes: 1