最近我們有個使用了jbpm 6.2(6.2是一個較大的里程碑)的批處理模塊,因為大BOSS一直覺得太重了,希望有更加輕量級的解決方案,因為我們基本上沒有真正意義上流程的概念,只有靜態的流程圖,因為一直忙於其他事情,於是這周才正式開始研究jbpm的一些細節(前幾年很多支持的項目中也接觸過,不過更多的是解決一些故障類問題,本身對流程類的不感冒)。順便研究了下jbpm。
jbpm的整體技術棧從用戶層面組成如下:
activiti技術棧:
bpmn web設計器:https://bpmn.io/,集成Activiti Modeler到項目中,可以參考http://whatlookingfor.com/2016/10/11/activiti%E5%85%A5%E9%97%A8%E5%85%AD-%E9%9B%86%E6%88%90%E6%96%B0%E7%89%88Activiti-Modeler%E4%B8%8ERest%E6%9C%8D%E5%8A%A1/index.html。
http://www.kafeitu.me/activiti/2013/03/10/integrate-activiti-modeler.html
模型只要符合bpmn2規范即可,不一定要使用activiti自己的設計器進行設計。數據庫可以中自己的DAO替換activiti實現,只要接口一致即可,REST也一樣,可以用應用自己的管理界面。支持web基於bpmn2的流程設計器。
jbpm的整體技術棧從實現層面組成如下:
在實際應用中,幾乎很少有直接使用jbpm kb的,一般都是集成到ERP或者portal中,不過是整合深入的問題,整合深入的可能只需要設計工具得到bpmn流程圖以及通過api調用運行時的一些功能。整合不深的可能就流程的流轉直接依賴於jbpm提供的整套方案。
jbpm 6 vs activities 5(不過activities是jbpm之后創始人分道揚鑣新搞的,這個很早就知道了,跟mysql和mariadb一樣):
- Embeddable, lightweight Java process engine, supporting native BPMN 2.0 execution
- human interaction using an independent WS-HT task service
- BPMN 2.0 process modeling in Eclipse (developers) and the web (business users)
- web tooling to model, deploy, execute and monitor your processes, including for example a data and form modeler, simulation, deployment, task lists, etc.
- web-based business activity monitoring and reporting that allows you to define your own reports
- managing and deploying your processes using technologies underneath like Git and Maven
- an execution server that you can remotely connect to (REST, JMS) and can be deployed in a clustered environment for load balancing and high availability
- tight, powerful integration with business rules and event processing
- Allows user updates to be combined with process updates in a single transaction
- Runs on any Java environment like Spring, JTA, standalone with any form of transaction demarcation.
- Easy to get up and running with the setup utility
- Built to support the cloud scalability from the ground up
- Very simple to add new custom activity types and complete dedicated process languages
- Rock solid
- Extremely fast
- Transactional timers
- Asynchronous continuations
- Hidden event listeners for decoupling software technical details from business level diagram
- Ability to test process executions in isolation in a plain unit test
Description
|
Activiti
|
jBPM
|
Community members
|
Activiti has a base team consisting of
Alfresco employees. In addition,
companies like SpringSource,
FuseSource and MuleSoft provide
resources on specific components. And of course, there are individual open source developers committing to the Activiti project.
|
jBPM has a base team of JBoss
employees. In addition there are individual committers.
|
Spring support
|
Activiti has native Spring support, which makes it very easy use Spring beans in your processes and use Spring for JPA and transaction management.
|
jBPM has no native Spring
support, but you can use Spring
with additional development effort.
|
Business rules support
|
Activiti provides a basic integration with the Drools rule engine to support the BPMN 2.0 business rule task.
|
jBPM and Drools are integrated on a project level and therefore there’s native integration with Drools on various levels.
|
Additional tools
|
Activiti provides a modeler (Oryx) and designer (Eclipse) tool to model new process definitions. But the main differentiator is the Activiti Explorer, which provides an easy-to-use web interface to start new processes, work with tasks and forms and manage the running processes. In addition it provides ad-hoc task support and collaboration functionality.
|
jBPM also provides a modeler
based on the Oryx project and a Eclipse designer. With a web
application you can start new
process instances and work with tasks. The form support is
limited
|
Project
|
Activiti has a strong developer and user community with a solid release schedule of 2 months. Its main components are the Engine, Designer, Explorer and REST application
|
jBPM has a strong developer and user community. The release schedule is not crystal clear and some releases have been postponed a couple of times. The Designer application is (at the moment of writing) still based on Drools Flow and the promised new Eclipse plug-in keeps getting postponed
|
其他特性還沒有仔細研究,后面會把我們實際用到的表使用以及重要性都梳理出來並更新(后續剝離敏感信息后發上來,也可以私信留言)。
最近繼續研究bpm相關的框架,在搜索jbpm 6和activities 5對比的時候,偶然發現2年前,jbpm的原創始團隊又另立門戶了,搞了個Flowable 6.0出來,參考:https://blog.csdn.net/hj7jay/article/details/68483096。這些坑大了,還是選擇jbpm吧,起碼后面的金主redhat為持續支持。
下面摘錄一份不恰當(不恰當是因為jbpm 5是被Jboss廢棄的版本)的jbpm 5和activities 5的對比:Activiti5與jBPM5技術組成對比
序號 | 技術組成 | Activiti | jBPM5 |
1 | 數據庫持久層ORM | MyBatis3 | Hibernate3 |
2 | 持久化標准 | 無 | JPA規范 |
3 | 事務管理 | MyBatis機制/Spring事務控制 | Bitronix,基於JTA事務管理 |
4 | 數據庫連接方式 | Jdbc/DataSource | Jdbc/DataSource |
5 | 支持數據庫 | Oracle、SQL Server、MySQL等多數數據庫 | Oracle、SQL Server、MySQL等多數數據庫 |
6 | 設計模式 | Command模式、觀察者模式等 | |
7 | 內部服務通訊 | Service間通過API調用 | 基於Apache Mina異步通訊 |
8 | 集成接口 | SOAP、Mule、RESTful | 消息通訊 |
9 | 支持的流程格式 | BPMN2、xPDL、jPDL等 | 目前僅只支持BPMN2 xml |
10 | 引擎核心 | PVM(流程虛擬機) | Drools |
11 | 技術前身 | jBPM3、jBPM4 | Drools Flow |
12 | 所屬公司 | Alfresco | jBoss.org |
國外還有一家自稱比jbpm 6 NB的工作流廠商,Camunda BPM 7,可以參考下。