-
1. Re: Persisting custom pojo classes using jbpm default persistence mechanism of JPA & JTA
ajithmathewsc Nov 21, 2013 6:48 AM (in response to ajithmathewsc)Can anyone point me to sample jbpm application that contains a persisted POJO? I want to be able to persist the values to the tables for the pojo class. All attempts to get things persisted from the bpmn diagram. From junits, i was able to persist by setting the transaction type as RESOURCE_LOCAL. When i use JTA as the persistence type, i am unable to persist the pojo class.
-
2. Re: Persisting custom pojo classes using jbpm default persistence mechanism of JPA & JTA
swiderski.maciej Nov 25, 2013 4:24 AM (in response to ajithmathewsc)can you post the code and process you used to do that? With that we can try to find out why the entity is not persisted properly. Have you received any errors or is it simply not put into data base?
HTH
-
3. Re: Re: Persisting custom pojo classes using jbpm default persistence mechanism of JPA & JTA
ajithmathewsc Nov 25, 2013 8:43 AM (in response to swiderski.maciej)Here is my sample project "Persistence-jBPM6.0.0.Final". I have a class called as StudentInfoDto which needs to be persisted. I have written Junit to test the same. I definitely missing something, I have created a sample script task which would initialize the dto class and set some values into it.
Please have a look into the code and let me know how to persist the dto class from the bpmn diagram ( as this would be needed for my project) and also from the junits !!
Thanks for your response!
-
Persistence-jBPM6.0.0.Final.zip 29.8 KB
-
-
4. Re: Re: Re: Persisting custom pojo classes using jbpm default persistence mechanism of JPA & JTA
swiderski.maciej Nov 26, 2013 6:45 AM (in response to ajithmathewsc)see attached fixed project. The missing parts where script task did not persist the entity but just created instance of it, then use bitronix data source to get the connections instead of defining it in persistence.xml
HTH
-
Persistence-jBPM6.0.0.Final.zip 54.5 KB
-
-
5. Re: Persisting custom pojo classes using jbpm default persistence mechanism of JPA & JTA
ajithmathewsc Feb 12, 2014 5:58 AM (in response to swiderski.maciej)We have an observation in our implementation of the jbpm process. Even though we are explicitly doing a persist / merge from the script task at various points, the database contains the changes either when the process gets completed or reaches some safe point.
Is it possible to commit into the database the changes before it reaches safe point / process gets completed?
-
6. Re: Persisting custom pojo classes using jbpm default persistence mechanism of JPA & JTA
swiderski.maciej Feb 13, 2014 1:52 AM (in response to ajithmathewsc)as I can see you have at least following option:
- use dedicated persistence unit that is resource local instead of JTA so it won't join active transaction that engine is managing and then you need to operate on entitymanager.getTransaction() yourself
- use service task that is backed by ejb bean that has transaction attribute set to requires_new so it will suspend current transaction and invoke given operation in its own transaction - not that this is more for JEE application servers as not all transaction managers support suspending transactions
HTH