1. 引子
关于工作流引擎的资料其实也不算少,网上的教程,书籍,还有某站很多视频教学内容。但针对kogito的,还是太少太少了。所以有了前面三节的尝试后,也许多了几天官方文档,初步整理一下,通过kogito究竟能做点啥?
2. 啥!
2.1. 业务流程建模
基于BPMN2标准来做流程建模,当前kogito版本为1.0.0.Final,还没有覆盖全部的BPMN2标准组件,但已经基本构用。具体可以查询官方说明。
据官方的描述,如果采用了BPMN2的一些建模工具,使用了kogito不支持的组件,你在编译代码时会报错;另随着kogito的版本升级,覆盖组件将会趋于完整。
2.2. 决策建模
- 支持基于基于DMN1.2标准的决策建模
- 支持基于DRL规则语言
- 支持基于excel文件的决策表
也可以同时使用这三种不同的规则工具,建立决策模型。总感觉有点叼叼的。
2.2.1 DMN
全称Decision Model and Notation (DMN) models,下图为官方的一个示例
This image is from kogito official document. You can find it from >>LINK<<
2.2.2 DRL
规则定义语言,在运行第二个示例时就有接触,如果拆分开,原属于规则引擎Drool定义的规则定义标准,定义如下:
package org.acme.travels
import org.acme.travels.Person;
rule "Is adult" ruleflow-group "person"
when
$person: Person(age >= 18)
then
modify($person) {
setAdult(true)
};
System.out.println($person.toString())
end
This sample is from kogito official document. You can find it from >>LINK<<
2.2.3 Excel
使用Excel来描述规则,引用官方的例子,如下图:
This image is from kogito official document. You can find it from >>LINK<<
2.2.4 决策引擎
大概译一下官网的原文吧:决策引擎是kogito的一个组成部分,可以存储,处理,验证数据,通过执行预先定义的业务规则,来得到最终的决定。
The decision engine is the Kogito component that stores, processes, and evaluates data to execute business rules and to reach the decisions that you define.
3. 总结
好像很强大,事实上应该也是一个很牛X的东西。就看用起来怎么样吧。