Why Flowable Is Gaining Popularity Among Java Developers
Flowable is an open‑source Java workflow engine that follows the BPMN 2.0 standard, offering tighter Spring Boot integration, full CMMN/DMN support, better performance than Activiti, and flexible deployment options, with detailed comparisons to Activiti and Camunda and step‑by‑step Spring Boot and standalone examples.
What is Flowable?
Flowable is an open‑source Java workflow engine that implements the BPMN 2.0 standard, allowing deployment of process definitions that the engine executes to create instances, assign tasks, and record history. It originated as a fork of Activiti; after the core Activiti team left, many optimizations and new features were added, making migration from Activiti straightforward.
Why Flowable is adopted
Java/Spring integration : the flowable-spring-boot-starter pulls in dependencies and configures the database, enabling the engine to run without a separate BPM platform.
Feature set : supports BPMN, CMMN (case management) and DMN (decision tables) in a single engine, eliminating the need for extra components.
Performance : async executor, lock‑granularity and batch‑processing optimizations give better stability under high concurrency compared with Activiti.
Embedding : can be embedded in any Java application or deployed as a standalone service, fitting intranet‑plus‑existing‑database deployment patterns.
Comparison with other Java workflow engines
Flowable vs Activiti
Maintenance activity : Flowable – high, continuous releases; Activiti – relatively low.
Performance : Flowable – async optimizations; Activiti – basic capabilities sufficient for many scenarios.
DMN/CMMN support : Flowable – fully supported; Activiti – limited support.
Typical scenario : Flowable – preferred for new projects; Activiti – suited for maintaining legacy projects.
Flowable vs Camunda
Architecture style : Flowable – classic embedded engine with relational DB; Camunda 7 similar, Camunda 8 moves to cloud‑native event streaming.
Learning curve : Flowable – moderate; Camunda 8 – steeper.
Ops tools : Flowable – basic UI, extensible; Camunda – richer Cockpit/Operate suite.
High‑concurrency handling : Camunda 8 + Zeebe stronger; Flowable sufficient but may require tuning.
Suitable scenarios : Flowable – Spring monolith or microservice embedding; Camunda – large‑scale distributed cloud‑native deployments.
jBPM, part of the Drools family, is worth considering for extremely complex rule‑heavy processes (e.g., risk scoring), but for typical approval flows Flowable or Camunda are lighter choices.
Typical Flowable architecture
Process definition files (e.g., .bpmn20.xml) are placed under resources/processes/. At application startup the engine auto‑deploys them. Business code interacts with the engine through APIs such as RuntimeService and TaskService, persisting data in a relational database.
Spring Boot leave‑approval example
Step 1 – Add starter dependency
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter-process</artifactId>
<version>7.0.1</version>
</dependency>Step 2 – Write the BPMN process file
<process id="leaveApproval" name="请假审批" isExecutable="true">
<startEvent id="startEvent"/>
<userTask id="managerApprove" name="经理审批" flowable:assignee="${manager}"/>
<endEvent id="endEvent"/>
</process>Step 3 – Deploy, start, query, and complete tasks
// Employee submits leave request
String instanceId = runtimeService
.startProcessInstanceByKey("leaveApproval", variables)
.getId();
// Manager queries pending tasks
List<Task> tasks = taskService.createTaskQuery()
.taskAssignee("李经理")
.list();
// Manager approves
taskService.complete(taskId, variables);Typical REST calls:
POST /leave/apply?employee=张三&manager=李经理&days=3
GET /leave/tasks?assignee=李经理
POST /leave/complete?taskId=xxx&approved=trueStandalone engine quick demo
Run Flowable in standalone mode with an H2 in‑memory database:
ProcessEngine engine = ProcessEngineConfiguration
.createStandaloneInMemProcessEngineConfiguration()
.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_TRUE)
.buildProcessEngine();
Deployment deployment = engine.getRepositoryService()
.createDeployment()
.addClasspathResource("expense-process.bpmn20.xml")
.deploy();
String instanceId = engine.getRuntimeService()
.startProcessInstanceByKey("expenseProcess", variables)
.getId();Official repository: https://github.com/flowable/flowable-engine
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
java1234
Former senior programmer at a Fortune Global 500 company, dedicated to sharing Java expertise. Visit Feng's site: Java Knowledge Sharing, www.java1234.com
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
