-1

Currently, I am developing a RESTful web service and a requirement is that I need to implement lots of scenarios to verify whether the customer business is valid or not. If those scenarios are invalid during the process of verification, the service must throw a service exception (e.g. 400) via REST service.

So, at this point as Drools and jBPM both are new for me. What should I choose among these to handle those scenarios efficiently and better integrate with my RESTful web service so that my goal would be better met?

I would appreciate a better suggestion with a sample resource, if available.

Thanks!

entpnerd
  • 10,049
  • 8
  • 47
  • 68
puru
  • 266
  • 5
  • 13

2 Answers2

1

IMO, this question is a better fit for the Software Engineering site, but since I can't flag the question to move it (because it has a bounty), I'll take a quick stab based on previous experience and hope that my answer helps you.

I've had experience working with Drools. You can enter rules fast, but what Drools inadvertently ends up doing is obfuscating core business logic from the development team (and everybody else), because the rules just aren't that easy to work with once they are in the system. I worked on a great team that used Drools for the core engine and everybody on the team just avoided it because the rules that went in there were untestable (because you can't really unit test Drools rules). Note that this was a team of highly skilled engineers at a very well known company. I won't go into more detail on that because of confidentiality though. Consequently, developers just avoided the most crucial aspects of a business critical system.

I haven't had experience with jBPM, directly, but its aim is to be useful to both developers and business users, which is good. However, you're going to have a tough time testing any logic in any kind of third party system, irrespective of how good it is.

Another potential option is to go with no third party option at all, and just hand code the logic. While not friendly to business users, if the rules you enter into your system are critical and it's really important that they have a comprehensive suite of regression tests, this may be your option of choice.

So I would try to hand code the rules and business logic if I could, but if you are forced to pick jBPM or Drools try jBPM. But I want to say that only you know the requirements of what you are developing. Research jBPM. Research Drools. Find out what they are well suited for through docs and find out how active their respective communities are. Also, create prototypes to see how easy it is for you to work with each of them. That's how you really want to find out the answer to your problem as opposed to having a voting system of coders saying "I like this one the best!". Best of luck in your evaluation.

Community
  • 1
  • 1
entpnerd
  • 10,049
  • 8
  • 47
  • 68
  • Thanks, It is really helpful. Appreciated!! – puru Dec 06 '16 at 15:18
  • In fact, you can create [test scenarios](https://docs.jboss.org/drools/release/6.5.0.Final/drools-docs/html/ch19.html#drools.TestScenarioEditor) in the Drools Workbench. You can also write Java unit tests for your rules. – livthomas Dec 06 '16 at 22:01
1

Drools is mostly business rule engine which means it can be used to execute a small chunk of code when some conditions are met. On the other hand, jBPM is a workflow engine capable of executing a business process, a sequence of actions that need to be done in order to accomplish some goal. Look at the description of these two areas to better understand what they are about and which one would be a better fit for your project.

Since you have mentioned that there is some verification process, I would probably go for jBPM. But it is hard to understand what exactly you mean by those scenarios and how you are going to do the verification.

livthomas
  • 1,160
  • 1
  • 14
  • 25