Lightweight workflow engine for Java
Asked Answered
C

13

48

Is it better to write a new workflow engine or to use an existing BPM engine: jBPM 5, Activiti 5?

My application is a web based application and performance is important. My doubt is whether using jBPM/Activiti will be a performance overhead compared to writing a simple workflow engine.

If I go with self implementation, I will miss visualization of workflow. For performance it can be traded.

Collogue answered 23/1, 2013 at 7:13 Comment(0)
G
20

This really depends on your requirements. First, see if you really need a workflow engine (this or other sources). Unless you really need it, probably you should avoid it.

If you really need what provides a workflow engine, I would pick one that is already built. People who works with jbpm or activiti have much more experience than you in building workflow engines, so it is probably already tunned to improve performance.

Gooding answered 23/1, 2013 at 12:36 Comment(0)
A
42

I agree with the guys that already posted responses here, or part of their responses anyway :P, but as here in the company where I am currently working we had a similar challenge I took the liberty of adding my opinion, based on our experience.

We needed to migrate an application that was using the jBPM workflow engine in a production related applications and as there were quite a few challenges in maintaining the application we decided to see if there are better options on the market. We came to the list already mentioned:

  • Activiti (planned to try it through a prototype)
  • Bonita (planned to try it through a prototype)
  • jBPM (disqualified due to past experience)

We decided not to use jBPM anymore as our initial experience with it was not the best, besides this the backwards compatibility was broken with every new version that was released.

Finally the solution that we used, was to develop a lightweight workflow engine, based on annotations having activities and processes as abstractions. It was more or less a state machine that did it's job.

Another point that is worth mentioning when discussing about workflow engine is the fact they are dependent on the backing DB - it was the case with the two workflow engines I have experience with (SAG webMethods and jPBM) - and from my experience that was a little bit of an overhead especially during migrations between versions.

So, I would say that using an workflow engine is entitled only for applications that would really benefit from it and where most of the workflow of the applications is spinning around the workflow itself otherwise there are better tools for the job:

Regarding state machines, I came across this response that contains a rather complete collection of state machine java frameworks.

Hope this helps.

Arrowroot answered 12/2, 2013 at 9:42 Comment(1)
the last link is brokenMending
I
28

Java based workflow engines like Activiti, Bonita or jBPM support a wide range of the BPMN 2.0 specification. Therefore, you can model processes in a graphical way. In addition, some of those engines have simulation capabilities like Activiti (with Activiti Crystalball). If you code the processes on your own, you aren´t as flexible when you need to change the process. Therefore, I would also advice to use a java based BPM engine.

I did a research concerning BPMN 2.0 based Open Source Engines. Here are the key-points which were relevant for our concrete use case:

1. Bonita:

Bonita has a zero-coding approach which means that they provide an easy to use IDE to build your processes without the need for coding. To achieve that, Bonita has the concept of connectors. For example, if you want to consume a web service, they provide you with a graphical wizzard. The downside is that you have to write the plain XML SOAP-envelope manually and copy it in a graphical textbox. The problem with this approach is that you only can realize use cases which are intended by Bonita. If you want to integrate a system which Bonita did not developed a connector for, you have to code such a connector on your own which is very painful. For example, Bonita offers a SOAP connector for consuming SOAP web services. This connector only works with SOAP 1.2, but not for SOAP 1.1 (http://community.bonitasoft.com/answers/consume-soap-11-webservices-bonita-secure-web-service-connector). If you have a legacy application with SOAP 1.1, you cannot integrate this system easily in your process. The same is true for databases. There are only a few database connectors for dedicated database versions. If you have a version not matching to a connector, you have to code this on your own.

In addition, Bonita has no support for LDAP or Active Directory Sync in the free community edition which is quite a showstopper for a production environment. Another thing to consider is that Bonita is licensed under the GPL / LGPL license which could cause problems when you want to integrate Bonita in another enterprise application. In addition, the community support is very weak. There are several posts which are more than 2 years old and those posts are still not answered.

Another important thing is Business-IT-Alignment. Modelling processes is a collaborative discipline in which IT AND the business analysts are involed. That is why you need adequate tools for both user groups (e.g. an Eclipse Plugin for the developers and an easy to use web modeler for the business people). Bonita only offers Bonita Studio, which needs to be installed on your machine. This IDE is quite technical and not suitable for business users. Therefore, it is very hard to realize Business-IT-Alignment with Bonita.

Bonita is a BPM tool for very trivial and easy processes. Because of the zero-coding approach, the lerning curve is very low and you can start modelling very fast. You need less programming skills and you are able to realize your processes without the need of coding. But as soon as your processes become very complex, Bonita might not be the best solution because of the lack of flexibility. You only can realize use cases which are intended by Bonita.

2. jBPM:

jBPM is a very powerful Open Source BPM Engine which has a lot of features. The web modeler even supports prefabricated models of some van der Aalst workflow patterns (workflowpatterns.com). Business-IT-Alignment is realizable because jBPM offers an Eclipse integration as well as a web-based modeler. A bit tricky is that you only can define forms in the web modeler, but not in the Eclipse Plugin, as far as I know. To sum up, jBPM is a good candidate for using in a company. Our showstopper was the scalability. jBPM is based on the Rules-Engine Drools. This leads to the fact that whole process instances are persisted as BLOBS in the database. This is a critial showstopper when you consider searching and scalability.

In addition, the learning curve is very high because of the complexity. jBPM does not offer a Service Task like the BPMN-Standard suggests In contrast, you have to define your own Java Service tasks and you have to register them manually in the engine, which results in quite low level programming.

3. Activiti:

In the end, we went with Activiti because this is a very easy to use framework-based engine. It offers an Eclipse Plugin as well as a modern AngularJS Web-Modeler. In this way, you can realize Business-IT-Alignment. The REST-API is secured by Spring Security which means that you can extend the Engine very easily with Single Sign-on features. Because of the Apache License 2.0, there is no copyleft which means you are completely free in terms of usage and extensibility which is very important in a productive environment.

In addition, the BPMN-coverage is very good. Not all BPMN-elements are realized, but I do not know any engine which does that.

The Activiti Explorer is a demo frontend which demonstrates the usage of the Activiti APIs. Since this frontend is based on VAADIN, it can be extended very easily. The community is very active which means that you can get help very fast if you have any problems.

Activiti offers good integration points for external form-technologies which is very important for a productive usage. The form-technologies of all candidates are very restrictive. Therefore, it makes sense to use a standard form-technology like XForms in combination with the Engine. Even such more complex things are realizable via the formKey-Attribute.

Activiti does not follow the zero-coding approach which means that you will need a bit of coding if you want to orchestrate services. But even the communication with SOAP services can be achieved by using a Java Service Task and Apache CXF. The coding effort is low.

I hope that my key points can help by taking a decision. To be clear, this is no advertisment for Activiti. The right product choice depends on the concrete use cases. I only want to point out the most important points in our project

Isagoge answered 14/9, 2015 at 14:34 Comment(1)
Bonita is licensed under the GPL V2 while Activiti is licensed under Apache 2.0 so if you write commercial software you can use Activiti but not Bonita.Miscall
G
20

This really depends on your requirements. First, see if you really need a workflow engine (this or other sources). Unless you really need it, probably you should avoid it.

If you really need what provides a workflow engine, I would pick one that is already built. People who works with jbpm or activiti have much more experience than you in building workflow engines, so it is probably already tunned to improve performance.

Gooding answered 23/1, 2013 at 12:36 Comment(0)
T
5

I recently open sourced Piper (https://github.com/creactiviti/piper) a distributed and very light weight, Spring-based, workflow engine.

Therewith answered 5/7, 2017 at 21:2 Comment(1)
I had a look at it and it looks very promising, I will give it a try. Thank youRefusal
S
3

I would like to add my comments. When you choose a ready engine, such as jBPM, Activity and others (there are plenty of them), then you have to spend some time learning the system itself, this may not be an easy task. Especially, when you need only to automate small piece of code.

Then, when an issue occurs you have to deal with the vendor's support, which is not as speedy as you would imagine. Even pay for some consultancy.

And, last, a most important reason, you have to develop in the ecosystem of the engine. Although, the vendors tend to say that their system are flexible to be incorporated into any systems, this may not be case. Eventually you end up re-writing your application to match with the BPM ecosystem.

Stamps answered 23/11, 2017 at 2:58 Comment(0)
L
2

The question is what you really want to achieve when you asking for a workflow engine.

The general goal which you would like to achieve by using a workflow engine, is to become more flexible in changing your business logic during runtime. The modelling part is surely one of the most important here. BPMN 2.0 is a de-facto standard in this area and all of the discussed engines support this standard.

The second goal is to control the business process in the way of describing the 'what should happen when...' questions. And this part has a lot to do with the business requirements you are confronted within your project.

Some of the workflow engines (Activity, JBPM) can help you to answer this requirement by 'coding' your processes. This means that you model the 'what should happen when..' paradigm in a way, where you decide which part of your code (e.g a task or an event) should be executed by the workflow engine in various situations. A lot of discussion is going about this concept. And developers naturally ask whether this may not even be implemented by themselves. (It is in fact not so easy as it seems at the first glance)

Some other workflow engines (Imixs-Workflow, Bonita) can help you to answer the 'what should happen when...' requirement in a more user-centric way. This is the area of Human-centric business process management, which supports human skills and activities by a task orientated workflow-engine. The focus is more on the distribution of tasks and processes inside an organisation. The workflow engine helps you to distribute a task to a certain user or user group and to secure, log and monitor a long running business process. Maybe these are the things you do not really want to implement by yourself.

So my advice is, not to mix things that need to be considered separately, because workflow covers a very wide area.

Llovera answered 29/8, 2016 at 22:5 Comment(0)
T
1

Yes, in my perspective there is no reason why you should write your own. Most of the Open Source BPM/Workflow frameworks are extremely flexible, you just need to learn the basics. If you choose jBPM you will get much more than a simple workflow engine, so it depends what are you trying to build.

Cheers

Tullis answered 25/1, 2013 at 16:8 Comment(2)
@sallaboy Yes. That is the confusion. What will be the performance overhead when using jBPM5 compared to own GOP framework which you explained in jBPM 3.2 Developer guide? Is jBPM twice slow? I dont need much functionalities provided by BPM engines. My need is simple statemachine based task execution.Collogue
If you are not planning to have long persistent business (high level processes) you can use simple frameworks. the GOP example was just a demonstration about how the internals of JBPM 3.x were created, but frameworks are usually more robust. If you are not using persistence and you don't need real time responses (less than 10ms) you are ok with jBPM5Tullis
R
1

I'd recommend you yo use an out-of-the-box solution. Given that the development of a workflow engine requires a vast amount of resources and time, a ready-made engine is a better option. Have a look at Workflow Engine. It's a lightweight component that enables you to add custom executable workflows of any complexity to any Java solutions.

Rabblerouser answered 27/4, 2017 at 18:29 Comment(0)
D
1

CamundaBPM is one option. You can check here: https://camunda.com/

Deus answered 5/4, 2020 at 16:34 Comment(0)
O
1

I also had to do the same in my work. I shortlisted Activiti, Camunda and jBPM as they're among the most powerful open source workflow engines in the industry and can handle complex enterprise processes. They're all under the terms of Apache License.

Activiti was forked off jBPM while Camunda was forked off Activiti.

In terms of modeler, Activiti and jBPM have web based modelers and Camunda has a desktop modeler. Activiti and jBPM also provide Eclipse plugins while Camunda does not. Activiti and Camunda's modelers use the BPMN.IO toolkit. If you have a requirement to embed the workflow models in your webapp, you can checkout the following links

If you want spring support, your best bet is Camunda as Activiti mention in their docs that their Spring support is experimental and jBPM does not provide native spring support

In terms of developer friendliness, Activiti and Camunda have good documentation and active community to help you get started. I found Camunda's documentation really helpful. But, I've heard jBPM's documentation is not helpful and that it is difficult to integrate.

In terms of performance, Camunda outruns Activiti and jBPM. There is scientific evidence that the Camunda BPMN engine performs better than the Activiti engine. Camunda BPM 7 performs 10x better than JBoss jBPM 6. Hence, Camunda is the best choice from a performance view point.

Camunda provides a higher BPMN coverage (almost full BPMN coverage) than Activiti. Contrary to Activiti and jBPM, Camunda has a robust persistence layer and provides advanced deadlock prevention. Whereas when using Activiti, intra process instance transactions still deadlock under high concurrency.

Camunda BPM 7 strategically aims for “Developer-Friendliness”, whilst JBoss jBPM 6 strives for the “Zero-Code-BPM”-ideal. Camunda BPM 7 offers innovative, powerful features that are missing from JBoss jBPM 6 such as CMMN, cockpit and container-support.

As Camunda performs better than the two alternatives and has high usability, I recommend Camunda.

I go the information through these sites, you can visit them

Oys answered 25/3, 2021 at 7:56 Comment(0)
F
0

I found one interesting to check using branching and conditions between nodes/states. I tried it and works perfectly, and is very lightweight. The only problem is that I cannot find it on maven central repo. https://github.com/francudina/Generic-Workflow-Architecture

Futility answered 4/5, 2023 at 20:30 Comment(0)
C
0

EasyFlows seems very good, but the project seems idle since 3 years. It's simple and does the job. No DB needed as it is not a distributed framework

https://github.com/j-easy/easy-flows

Cower answered 2/8, 2023 at 9:2 Comment(0)
D
-1

You can look @ Apache Ant to build a workflow engine.Its much more robust and is a pure state-machine with most of the requirements needed already built in.

Apart from that you can also embed different dynamic code/scripts in Java/Groovy/JS language and hence that makes it very powerful. Also it allows tasks extension.

There is some fair amount of tooling around it or you can build on top of it if a IDE is needed.

Update : Spring state machine is also available which is relatively light weight and not bloated : https://projects.spring.io/spring-statemachine/

Dropwort answered 22/5, 2014 at 14:25 Comment(2)
how would you build a state machine on top of ant?Arrowroot
Ant is a pure task execution engine with conditional workflows & dynamic decision making capabilities.So when i say task that's the state of a system.Dropwort

© 2022 - 2024 — McMap. All rights reserved.