终止任何步骤的流程(jbpm) [英] Terminate process at any step (jbpm)
问题描述
我想在我的jbpm项目的任何用户任务中实现终止流程实例的功能.我知道从理论上讲我应该能够通过将终止结束事件附加到我的工作流中的任何任务上来执行此操作,但这对于拥有如此多的终止事件似乎是一个糟糕的解决方案.
I'd like to implement the ability to terminate the process instance at any user task of my jbpm project. I know that I should theoretically be able to do this with a termination end event attached to any task in my workflow, but this seems like a bad solution to have so many terminate events.
是否有更好,更有效,更易读的方法来做到这一点?
Is there a better, more efficient, more readable way to do this?
推荐答案
我不知道这是否更好,但是您可以这样做:
I don't know if this is better, but you can do this:
- 并行建模一个中间捕获信号,后跟您的终止事件
- 使用方法SignalEvent
kcontext.getProcessInstance().signalEvent("terminate",null);
在人类任务"上使用空格退出脚本"来通知提到的信号,其中终止"是信号事件捕获的信号名称.
- model, in parallel, a intermediate catch signal followed by your terminate event
- use the space "On Exit Script" on Human Task to notify mentioned signal, using method signalEvent
kcontext.getProcessInstance().signalEvent("terminate",null);
where "terminate" is the signal's name catched by your Signal Event.
在这里您可以看到一种方法: http://s7.postimg.org/p6ktmvz0r/Screen_Shot_2015_01_18_48_at_19 .png
Here you can see a approach: http://s7.postimg.org/p6ktmvz0r/Screen_Shot_2015_01_18_at_19_45_48.png
这篇关于终止任何步骤的流程(jbpm)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!