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

0

1

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.

Submerged answered 26/8, 2015 at 16:31 Comment(2)
Hello, did you find a solution?Wrestle
No, I did not. I stopped working on that stuff.Submerged

© 2022 - 2024 — McMap. All rights reserved.