JBPM: How to run a sql query from a service task?[ver 6.2]

我是研究僧i 提交于 2019-12-11 11:47:08

问题


My objective is to get data from a table stored in MySQL db. For that I have created a custom service task which pulls out the relevant data using hibernate. It works as expected when I run it as a java application on Eclipse. It complains that it is not able to find the required 'persistence unit' when run on the server.

I'm pushing my project using git onto kie-workbench(not sure if it's a good way) and had to make a few modifications to couple the work item with work item handler. Work item handler gets called when the process instance reaches the service task, but is not able to find the persistence unit.

There is a persistence.xml which has the required PU under my project's META-INF, but, apparently, workbench requires it somewhere else. How do I add it to the existing persistence.xml that workbench uses internally? Or is there a better way to do it? How else do I pull up information from DB and display it on a user task, if this is not the correct way?

PS - I just got started with jbpm, so don't have much knowledge of how things work.

Thanks in advance.

[UPDATE] I modified the persistence.xml on the jbpm-console.war, so now it's able to find the required persistence unit. I'm not sure if this is the correct way to do it.

来源:https://stackoverflow.com/questions/32232010/jbpm-how-to-run-a-sql-query-from-a-service-taskver-6-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!