Embedding and Testing Drools Flow in your Java Project

Drools Flow provides workflow capabilities and can easily integrate rules with processes. You can easily define the series of steps that would be followed in a workflow using the flowchart based approach to get a rule file. All this works like a charm with the drools plugin in eclipse and if you are interested then there is good information here to work with the plugin. This post however talks about a few struggles that I had to face to embed the drools flow in my Java based project.

Anyway, one of the problems that I see with the maven way of doing things is that many big projects would host a maven repository on their own rather that put it on maven central. Though, I am not a proponent of this approach as it makes findings libraries difficult for me as a developer, however, as per Spring, there are reasons why they do it that way. JBoss also does it this way.

The repository for Jboss through which you would get the drools file is

notice that I used, 5.1.1, there is 5.2.0.Snapshot as well but when I checked, that does not exist for drools-process-task. The main libraries required are drools-compiler, drools-core and drools-process-task. There is also an xstream requirement.

Once this was done, as a sample, I was able to execute the following code in my project

Share the Knol:

Related

Vikas is the CEO and Co-Founder of Knoldus Inc. Knoldus does niche Reactive and Big Data product development on Scala, Spark, and Functional Java. Knoldus has a strong focus on software craftsmanship which ensures high-quality software development. It partners with the best in the industry like Lightbend (Scala Ecosystem), Databricks (Spark Ecosystem), Confluent (Kafka) and Datastax (Cassandra).
Vikas has been working in the cutting edge tech industry for 20+ years. He was an ardent fan of Java with multiple high load enterprise systems to boast of till he met Scala. His current passions include utilizing the power of Scala, Akka and Play to make Reactive and Big Data systems for niche startups and enterprises who would like to change the way software is developed.
To know more, send a mail to hello@knoldus.com or visit www.knoldus.com

Knoldus is the world’s largest pure-play Scala and Spark company. We modernize enterprise through
cutting-edge digital engineering by leveraging Scala, Functional Java and Spark ecosystem. Our mission is to provide reactive and streaming fast data solutions that are message-driven, elastic, resilient, and responsive.

Knoldus is the world's largest pure-play Scala and Spark company. We modernize enterprise through
cutting-edge digital engineering by leveraging Scala, Functional Java and Spark ecosystem. Our mission is to provide reactive and streaming fast data solutions that are message-driven, elastic, resilient, and responsive.