在jBpm中,如何获取流程/流程中发生的所有转换?
jboss jBpm 是否可以获取一个进程执行期间发生的所有转换?
用例是:我们现在希望了解“用户”已经经历过的所有节点、任务节点、...以及他们进行了哪些转换。
这显示了从当前活动令牌/节点到开始任务之前已完成的任务实例列表。
已经探索了一些不可行的想法:
- 获取活动令牌及其相应的节点,并通过到达的转换沿着转换向上移动。 这不起作用,因为可以传入多个转换,因此我们不知道已进行哪个转换。
也许我应该调查 JBPM_LOG 表,但我没有找到查询此表的正确方法(API)。 对任何在线文档的任何建议也将受到欢迎。
注意:我们使用的是jBpm版本:3.3.1
Is it possible in jboss jBpm to fetch all transitions that has been taken during one process execution?
The use case is: We would like to now all nodes, tasknodes, ... that 'users' has been through and which transition they took.
This to show a list of task instances that have been finished previously from the current active token/node till the start task.
Some not working ideas already explored:
- Take the active tokens and their corresponding node and travel up the transitions through the arriving transitions. This does not work as multiple transitions can be incoming, so we do not know which transition has been taken.
Probably I should investigate the JBPM_LOG table, but I didn't found a proper way (API) to query this. Any suggestions to any online documentation would also be welcome.
Note: We are using jBpm version:3.3.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,如果需要获取转换,则需要使用 jbpm_log 表。 要获取所有进行的节点,您只需要 jbpm_taskInstance 表。
我们使用 HQL 来获取所有用户的转换过程。 我有一个关于“了解给定任务实例选择的转换用户”的任务。 这不是做这样的事情的明显方法,但我无法发明更清晰的东西。 就我而言,这在应用程序中不是一个非常常见的操作,因此它以“最快编码”的方式实现。 显然,在您的情况下,对单个任务实例进行 3 个查询并不是一个好的选择。
我需要的唯一文档是: http://docs.jboss.org/jbpm/v3/ javadoc/ 有关 Jbpm 类和包以及鉴别器类列表的帮助:jbpm-jpdl.jar/org.jbpm.logging.log/ProcessLog.hbm.xml(有关于 jbpm 对象 - DB 表映射的描述)
这是该方法的代码。 CriteriaSQL 是我们的 CriteriaParams 包装器。
正如我所说,这不是最好的例子,但如果您需要的话,我还保存了 Oracle DB 的纯 sql 查询。
Yes, you need to use jbpm_log table if you need to get transitions. To get all proceeded nodes you only need jbpm_taskInstance table.
We use HQL to get all user's transition in process. I had a task about "to know wich transition user choosed for given taskInstance". It's not a obvious way to do such thing, but i cannot invent something more clear. In my case it's not a very common action in app so it's realized in "fastest-to-code-it" way. Obviously 3 queries for single task instance in your case is not a good choose.
The only docs i needed were: http://docs.jboss.org/jbpm/v3/javadoc/ for help on Jbpm classes and packages and discriminator's class list: jbpm-jpdl.jar/org.jbpm.logging.log/ProcessLog.hbm.xml (has desciption about jbpm objects - DB table mapping)
This is the method's code. CriteriaSQL is our CriteriaParams wrapper.
As i said it isn't best example but I also have saved plain sql queries for oracle DB if you needs it.
我们像这样使用 sql select(必须在文件 jbpm.cfg.xml 中启用登录表 JBPM_LOG):
这使用事先连接 - 我不知道这是否适用于除 oracle 之外的其他任何东西。
We use sql select like this (logging into table JBPM_LOG must be enabled in file jbpm.cfg.xml):
This uses connect by prior - I don't know if this work on anything other than oracle.
这是针对已经完成或部分处理的流程吗? 如果没有,那么您可以在每个退出转换上放置一个操作处理程序,通过在当前标记中查找来记录转换的名称。
Is this for Processes that have already been completed or partially processed? If not, then you could put an action handler on every exit transition that records the name of the transition by looking for it in the current token.