alibaba / smartengine Goto Github PK
View Code? Open in Web Editor NEWSmartEngine is a lightweight business orchestration engine.
License: Apache License 2.0
SmartEngine is a lightweight business orchestration engine.
License: Apache License 2.0
url: 中文版UserGuide
origin: 值的一提
expected: 值得一提
考虑未来加入历史记录表吗?
随着流程的增加,表中的数据会越来越多
考虑把已完结的流程存入历史记录表来减轻审批中数据表的压力吗?
设计器还开源不
并行网关执行的时候,默认使用便利模式; 当实现了ExecutorService后, 使用并行模式这里看代码是
在 ParalleGatewayBehiavior 中的处理
executorService.invokeAll(tasks);
执行的所有并行callable, 这里好像没有异常处理呢, 当某一个并行线程抛出异常的时候, 这里就把异常吃掉了整个流程不报错; 我理解这里应该可以定制线程中抛出异常中断流程或者继续执行呢, 这个部分是怎么考虑的呢
1.流程启动DefaultProcessCommandService.start方法中,业务加锁,此处新增流程实例,然后根据流程实例id加锁,那么不是相同的业务在并发的场景下还是会创建出2个流程实例,这个地方的锁似乎是没有用的。
private void tryInsertProcessInstanceIfNeedLock(ProcessEngineConfiguration processEngineConfiguration,
ProcessInstance processInstance) {
LockStrategy lockStrategy = processEngineConfiguration.getLockStrategy();
if(null != lockStrategy){
ProcessInstance newProcessInstance = processInstanceStorage.insert(processInstance, processEngineConfiguration);
lockStrategy.tryLock(newProcessInstance.getInstanceId());
}
}
2.在子流程创建的时候,如果加了锁策略,会导致子流程实例无法创建,代码跑到update方法中去了。
public static ProcessInstance insertAndPersist(ProcessInstance processInstance, Map<String, Object> request,
ProcessEngineConfiguration processEngineConfiguration) {
ProcessInstance newProcessInstance ;
//TUNE 可以在对象创建时初始化,但是这里依赖稍微有点问题
AnnotationScanner annotationScanner = processEngineConfiguration.getAnnotationScanner();
ProcessInstanceStorage processInstanceStorage = annotationScanner.getExtensionPoint(
ExtensionConstant.COMMON,ProcessInstanceStorage.class);
LockStrategy lockStrategy = processEngineConfiguration.getLockStrategy();
if(null != lockStrategy){
newProcessInstance = processInstanceStorage.update(processInstance, processEngineConfiguration);
}else{
newProcessInstance = processInstanceStorage.insert(processInstance, processEngineConfiguration);
}
persisteVariableInstanceIfPossible(request, processEngineConfiguration,
newProcessInstance, AdHocConstant.DEFAULT_ZERO_VALUE);
persist(newProcessInstance,processEngineConfiguration);
return newProcessInstance;
}
bpmn和标准的语法还是有差异。请问有配套的设计器和idea插件么,开发起来感觉没有那么习惯。
另外提个小意见,如果流程定义,持久化在远端存储里,在应用端采用custom来跑。两个extension使用起来,都比较费劲:
1)应用端,集成client和custom扩展包,但是需要从远端加载流程定义,并deploy到本地,需要自己实现storage和dao层
2)管理端,只需要deploy流程定义到远程存储,只能使用mysql扩展,但是facade没有只deploy远端的接口。只能直接从dao层开始自己包装。
好像不支持显示支持方法调用和参数传递。
<serviceTask id="executeTask" name="ExecuteTask" smart:class="com.alibaba.simplest.bpm.util.AuditProcessServiceTaskDelegation"> </serviceTask>
这个里边能传递参数么例如
<serviceTask id="executeTask" name="ExecuteTask" smart:class="springBean.method(param1,param2)"> </serviceTask>
如果要实现这个需要怎么扩展呢, 能一些思路么。
显示的调用方法,开发同学看起来更直观, 不然针对每个任务都需要写个代理类
Invalid bound statement (not found) 提示找不到dao里面的方法
目前的master分支缺少ServiceTaskBehavior 导致xml配置了serviceTask都会报错
custom模式,并行网关在执行的时候有一个NPE的bug,线程池在复用的时候,多次运行同一个process,会出现一个奇怪的现象:
初步怀疑InheritableThreadLocal,线程池中ThreadLocal变量拷贝有点问题。docs中注释有声明只要在子线程创建的时候,才会拷贝线程变量。
Inheritable thread-local variables are used in preference to ordinary thread-local variables when the per-thread-attribute being maintained in the variable (e.g., User ID, Transaction ID) must be automatically transmitted to any child threads that are created
以下是堆栈内容
java.lang.NullPointerException: null at com.alibaba.smart.framework.engine.persister.custom.CustomExecutionInstanceStorage.findActiveExecution(CustomExecutionInstanceStorage.java:95) at com.alibaba.smart.framework.engine.bpmn.behavior.gateway.ParallelGatewayBehavior.enter(ParallelGatewayBehavior.java:107) at com.alibaba.smart.framework.engine.pvm.impl.DefaultPvmActivity.enter(DefaultPvmActivity.java:32) at com.alibaba.smart.framework.engine.behavior.base.AbstractActivityBehavior.leave(AbstractActivityBehavior.java:127) at com.alibaba.smart.framework.engine.pvm.impl.DefaultPvmActivity.execute(DefaultPvmActivity.java:86) at com.alibaba.smart.framework.engine.pvm.impl.DefaultPvmActivity.enter(DefaultPvmActivity.java:43) at com.alibaba.smart.framework.engine.bpmn.behavior.gateway.ParallelGatewayBehavior$PvmActivityTask.call(ParallelGatewayBehavior.java:183) at com.alibaba.smart.framework.engine.bpmn.behavior.gateway.ParallelGatewayBehavior$PvmActivityTask.call(ParallelGatewayBehavior.java:171) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
另外两个bug上报下,下面是修改后的diff
流程设计器+后台管理页面什么时候开源?和阿里内部版本有什么区别?
@vavi
感谢提供了如此优秀的工作流引擎,请教下jumpTo和jumpFrom的使用场景
ExecutionInstanceEntity executionInstanceEntity = new ExecutionInstanceEntity();
executionInstanceEntity.setId(Long.valueOf(executionInstance.getInstanceId()));
java.lang.NumberFormatException: For input string: "0dac1945-c1c6-4dec-b175-b5871d153da7"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.valueOf(Long.java:803)
at com.alibaba.smart.framework.engine.persister.database.service.RelationshipDatabaseExecutionInstanceStorage.buildExecutionInstanceEntity(RelationshipDatabaseExecutionInstanceStorage.java:49)
各位老师,请问审批人如何选择,没找到demo案例呢,谢谢
为什么我把数据源从H2替换为mysql后,运行示例,数据库里没有产生数据?
看日志sql语句也都打印了,运行也成功了,把TaskServiceTest测试类上的@transactional注解去掉就可以产生数据,是哪里配置了事务回滚吗?
能提供个示例代码就更好了,wiki 打不开一直跳转到代码页
useGeneratedKeys="true"
目前2.5.7.2的版本不支持流程结束事件,看了源码,源码已经修复了,麻烦打个新的jar包。谢谢
有配套的流程设计器吗?要不怎么用呢
http://gitlab.alibaba-inc.com/smart-framework/simplest-bpm-demo
test类有点看不懂~~~
服务编排提供条件判断吗,test用例没有看到服务编排条件
检测到 alibaba/SmartEngine 一共引入了161个开源组件,存在7个漏洞
漏洞标题:Fastjson 1.2.25-1.2.47版本远程代码执行漏洞
缺陷组件:com.alibaba:[email protected]
漏洞编号:
漏洞描述:Fastjson 是Java语言实现的快速JSON解析和生成器,在1.2.25-1.2.47版本中攻击者可通过精心构造的JSON请求,绕过此前修复机制,远程执行任意代码。
漏洞原因:
攻击者可通过白名单类java.lang.Class绕过checkAutotype方法,利用fastjson的cache机制引入恶意类,并调用连接远程rmi主机,通过其中的恶意类执行代码。
影响范围:[1.2.25, 1.2.48)
最小修复版本:1.2.48
缺陷组件引入路径:com.alibaba.smart.framework:[email protected]>com.alibaba:[email protected]
另外还有7个漏洞,详细报告:https://mofeisec.com/jr?p=a692b9
并行网关执行的时候,默认使用便利模式; 当实现了ExecutorService后, 使用并行模式这里看代码是
在 ParalleGatewayBehiavior 中的处理
executorService.invokeAll(tasks);
执行的所有并行callable, 这里好像没有异常处理呢, 当某一个并行线程抛出异常的时候, 这里就把异常吃掉了整个流程不报错; 我理解这里应该可以定制线程中抛出异常中断流程或者继续执行呢, 这个部分是怎么考虑的呢
是不是没支持eventBasedGateway,怎么解决对应场景的呢? @vavi
目前引入两个包,就会冲突报错,找到了两个 ExecutionInstanceStorage
Failed to instantiate [com.alibaba.smart.framework.engine.SmartEngine]: Factory method 'constructSmartEngine' threw exception; nested exception is com.alibaba.smart.framework.engine.exception.EngineException: Duplicated bindKeyClass found interface com.alibaba.smart.framework.engine.instance.storage.ExecutionInstanceStorage for group common, because of duplicated annotation or init twice.
看了2.2.3.2版本的更新内容,storage-mysql和storage-mongodb中都取消了对spring的依赖,但是却利用InstanceAccessor的实现类来实现spring容器中对象的获取,这样就规定了InstanceAccessor的实现类必须能从spring中获取对象,同时storage-mysql也是基于mybatis来进行数据的持久化。所以想请问一下,未来有将这块数据持久化相关内容完全脱离spring和mybatis的规划吗?
有钉钉群吗?
@Override
public void enter(ExecutionContext context) {
ActivityBehavior behavior = this.getBehavior();
boolean needPause= behavior.enter(context, this);
fireEvent(context,PvmEventConstant.ACTIVITY_START.name());
if (needPause) {
// break;
return;
}
this.execute(context);
}
这里要不做个特判?behavior instanceof ParallelGatewayBehavior 则进行一些并行特殊处理,现在有npe问题,后面this.execute(context);也很奇怪
有没有稳定的版本可以用于生产使用?有没有搭配的流程配置页面?
目前项目示例太少,希望能多增加些示例,提供与springboot整合jar包。
顺序会签中审批节点驳回后,流程直接abort。这个貌似不是很合理
现在已经支持还是在规划中
DeploymentInstance creation use version parsed from processDefinitionContent
com.alibaba.smart.framework.engine.service.command.impl.DefaultDeploymentCommandService#createDeployment
.
But while updating DeploymentInstance, it ignored the version from processDefinitionContent, which break the consistency of version column of se_deployment_instance and the version in process_definition_content.
没有看到web设计器或idea plugins之类的工具,需要自己开发么?
并行节点执行时,ExecutionContext对象是共用的,executionContext.getActivityInstance()值会混乱
smartengine.org 和 www.omg.org 的都无法获取
获取不到xsd文件
通过设置添加ExecutorService的方式使用并行网关时,PersisterSession在主线程与线程池之间传递时偶发传递失败,出现NPE;
com.alibaba.smart.framework.engine.persister.custom.CustomExecutionInstanceStorage#findActiveExecution
ProcessInstance processInstance = PersisterSession.currentSession().getProcessInstance(processInstanceId);
其中PersisterSession.currentSession()返回null 导致NPE;
经检查发现PersisterSession.sessionThreadLocal 用的是InheritableThreadLocal, 在使用线程池时这个类是会出问题的, 建议改成transmittable-thread-local试一下;
仔细阅读了一下,感觉挺不错,但有几点疑虑
1、文档太少,都2.0版本了,没有案例,没有starter,没有sample,对于我们团队来说,社区支持还是很重要的;
2、有未来的技术或者版本推进路线图嘛,也好团队评估使用的前景如何
3、建议文档中,多增加点场景,例如,节点权限集成等内容
并行节点执行时,ExecutionContext对象是共用的,executionContext.getActivityInstance()值会混乱
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.