Java Workflow Engines Comparison
Reading time: 7 minutes 6 seconds
Reading time: 7 minutes 6 seconds
There are quite a lot of open source solutions that are geared towards workflow process automation. The question is how to choose the right one and what factors should be taken into account. Below you may find a table that provides a comparison of Java workflow engines available on the market, including their major features description.
|Workflow types||State machine||State machine||State machine||State machine||State machine|
|Supported databases||MS SQL, PostgreSQL, Oracle, MySQL, H2, RavenDB, MongoDB, Redis, GridGain and Ignite||MS SQL, PostgreSQL, Oracle, MySQL, H2, DB2||db2, derby, h2, hsqldb, mysql, oracle, postgresql, sqlserver||MS SQL, PostgreSQL, Oracle, MySQL, H2, DB2, MariaDB||PostgreSQL, Oracle, MySQL, H2, Apache Cassandra|
|State persistence||Type of serialization is defined by Persistence Provider. The settings saving is easily controlled and changed||Activiti supports recovery in case of error and restart by being a transactional state machine at the lowest level.||The runtime state of an executing process can be made persistent, for example, in a database. This allows to restore the state of execution of all running processes in case of unexpected failure.||Persistence Strategy based on the following concepts - Compact Tables, Deadlock Avoidance, Control Savepoints, Intelligent Caching, True Concurrency.||Not declared|
|Versioning & upgrading||The processes that were created before the schema change, work under the old scheme, whereas the scheme of the specific process is updated after calling the appropriate command.||Versioning only||Both||With the use of additional converters||Yes, you can dynamically modify workflows at runtime. As soon as you save the changed code, Copper compiles it automatically and loads it.|
|Scheme format||The proprietary format based on XML. Import and export to BPMN2 starting with version 2.1.||BPMN2||BPMN2||BPMN2||Process scheme is declared as Java-code|
|Installing the process in an arbitrary state||Yes, by calling a single method||Yes||Yes||Yes||Yes|
|Obtaining a list of available states for the current process||Yes, by calling a single method||Yes, by calling a single method||No||No||Unknown|
|Built-in authorization of access to external actions (commands) for the workflow||Yes||No||No||No||No|
|Timers and delays||Yes||Yes||Yes||Yes||Yes|
|Obtaining a list of available external actions for the current process||Yes, by calling a single method||No||No||No||No|
|Simulated process execution||Yes, this mode is called Pre-Execution.||No||No||No||No|
|Modifying schemes at runtime||Yes, built in.||No||No||No||Yes|
|Obtaining process lists for Inbox and Outbox folders||Yes||No||No||No||No|
Workflow management systems usually support three types of workflow: sequential workflow, state workflow and rule-driven workflow. Sequential workflows move from one task to another, without stepping back in sequence. Since such workflows move to the next activity when the previous is finished, they are more likely to be used when decision making process could be encoded inside the workflow. State machines, on the contrary, are used when decision-making occurs outside the workflow. They go from one state to another and have to wait for a certain event that will trigger a transition from one activity to another. As a result, state machines are great for defining processes that involve human interaction. Rule-driven workflows use conditions under which a transition from one step to another occurs. They might be used for resolving complicated issues when your business requirements are changed quite often. However, rule-driven workflows might also add complexity to your system.
An in-built designer allows you to easily create custom workflows of any complexity. It frees you up from writing code and, as a result, greatly reduces the time spent on the development of templates and components. Moreover, visual designer provides users with easy navigation, so you don't have to be a developer or a technically skilled person to work with it. Basically, all you need to do is to drag and drop your workflow activities on your design canvas and connect them with transitions.
It is always better to choose an engine that is supplemented with a number of database providers. For instance, if you are using MongoDB and the engine that you've chosen doesn't support it, you will need to write your own provider. To do this, you'll have to involve additional resources and spare some time.
You will need long-running operations support in case you have activities that take substantial amount of time to complete. Such processes as approving of a document or signing a contract are usually long-running, since it might take weeks or even months to reach an agreement. Instead, their state may be persisted till the final decision is made. Hence, if your business processes take long time, you should opt for those Java workflow engines that support long-running operations.
Seamless integration presupposes that you may add new features to your system without errors or possible complications. The table above will give you a hint on how easy it is to integrate some of the best Java workflow engines in the market.
Persistence is one of the most important features, especially for long-running workflows. When persisted, the workflow is either removed from a memory or delayed to a later time. For example, you are waiting for a customer to review and sign an agreement. In some cases it might take a week or two to do it. However, it isn't practical to have this state in memory for two or more weeks, waiting for the customer to send the signed document. Instead, you may make it idle for a period during which the customer is reviewing the agreement and activate it once he sends it back. This feature might not be required for short-lived workflows. However, if you want flexibility or your workflow includes long-running tasks that involve human interactions, persistence becomes an essential element.
An in-built version control helps you keep track of any changes introduced to your workflows and revert them upon necessity. Whenever you update a workflow the engine versions your changes, letting you choose whether you want existing processes to finish running the old version or to force them to run a new one.
BPMN (Business Process Model and Notation) is arguably the most commonly used format when it comes to business process modeling. It helps to describe business processes through the usage of graphical notation. Its major benefit is that it is understandable not only by developers, but also by business people.
If you have other software that supports BPMN or making a switch to another workflow engine, consider those engines that support BPMN. If the engine uses any format other than BPMN, make sure it has some tangible advantages when compared to BPMN format (for example, compact notation, fewer objects, etc.).
Let's assume that you have an urgent document that should be approved by three different people: first it needs the approval of your department manager, then a lawyer and, finally, a general manager. As a rule, the general manager won't be able to sign the document till the department manager approves it. If the manager is out of office for quite some time, you will be stuck waiting for their return. The possibility to install processes in an arbitrary state allows you to avoid such an unwelcoming situation and set the running process to an arbitrary state, bypassing whatever it is that you need to bypass.
Built-in authorization allows business owners to regulate user access. This feature is particularly useful for large enterprises. By defining who may take actions on specific states, you have a possibility to prevent users from doing operations that they shouldn’t do.
Timers allow you to trigger transitions to certain activities within your workflow. Imagine that you want your employee to create some document within a fixed time. If the document is not ready within the given period of time, the employee’s manager will receive a notification about it. Or you may set a timer according to which if a reviewer doesn’t take action upon a document within a given timeframe, it becomes automatically approved or rejected.
This feature provides you with an opportunity to see how your newly created scheme will work. Simulated process execution enables you to run the scheme and see whether you have modelled the scheme correctly and if there are any errors.
This feature might be useful if you found an error in a running scheme (for example, wrong sequence of process stages) and want to correct it. You may also use it when you want to make certain adjustments and modifications at runtime.
Some workflow engines allow you to obtain information from the user’s inbox or outbox folders. For example, reviewing your employee’s inbox, you may find out at what stage the process is at a given time, what steps should be taken or who is the next person to act.