cancel
Showing results for 
Search instead for 
Did you mean: 

Implementation of Persistence

chrisc
Champ in-the-making
Champ in-the-making
Congratulations on your work with Activiti. I was looking at jBPM 4 but realized that jBoss' support for it seems to be waning.

It appears as though jBoss used Hibernate for its persistencet. Does Activiti use an ORM for it's persistence?

I was hoping to find a BPM engine that persists it's objects using a standardized implementation like JDO or JPA. There are libraries that provide an abstracted ORM interface so that frameworks can be written in a generic and portable way to use any persistence standard. We have even created our own called exPOJO. An application using Hibernate, JDO or JPA can simply use a library written on top of exPOJO and plug in the appropriate ORM implementation for their persistence technology. In this way the framework has more appeal as users of all ORM implementations can 'get on board' with it.

If Activiti was written using exPOJO we could readily use it in our application.

I just read that you only support H2 database currently which probably indicates that you don't use an ORM otherwise you would be readily able to support the wide range of databases that most ORM support. Is this correct?
7 REPLIES 7

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Activiti uses iBatis. There is a topic which describes the 'why'.

JDO is old, so using yet another abstraction layer to have either JDO, JPA or Hibernate is imo a solution that is even more wrong. But if you decide you want a JPA(2?) based persistence layer, I'm willing to help out as wel. But…

The persistence of Activiti is completely hidden. You can share transactions if you use JTA, you can even inject your own datasource, you can persist JPA entities from their own entitimanager as process variables etc… So there is no real problem here, at least I've not seen/encountered any. Yes, there are maybe certain CTO's or 'architects' requirering  an uniform persistence layer in 'their applications', but these people should be fired for their incompetence. 🙂

And where did you read that only H2 is supported? Just read the docs. It is true that the demo setup is reduced to only supporting H2 easily out of the box, but that is imo a good choice. So many people that were not competent enough, were doing wrong things that the number of posts about this in the forum caused to much work (these people often did not search the forum etc). In addition the time to make it even simpler is simply not there. People that realy want to use a different db and are capable, will achieve this easily.

gregory1
Champ in-the-making
Champ in-the-making
The persistence of Activiti is completely hidden, but it is not the best solution in every case.
Let's talk about the situation when there is a requirement to display data joined from two different subsystems (one of them is bpm).
It's much easier to make such join on lower level (like db or jpa) then querying and joining results in format determined by Activiti API with something else (e.g. JPA entities), and applying any additional elements like filtering, sorting, etc.

So, maybe there are certain CTO's or 'architects' requirering an uniform persistence layer in 'their applications', but it doesn't make them incompetent.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
What data would you like to join?

heymjo
Champ on-the-rise
Champ on-the-rise
a simple example of joining data: when a task is assigned we store the user id in the assignee field. When the list of assigned tasks is displayed in an application we need to show the assignee full name.

our  options:

1) store the full name as a process variable upon assignment
2) upon retrieval of the tasks join against a user table that has the complete info
3) after the tasks are retrieved from activitiy, wrap the taskentities and add getFullName where we do a lookup in the user table.

We went for 3) but 2) would have been nicer. 1) seemed ugly.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Since user data is used and retrieved very often, we kind of 'cache' that (memory is cheap) The 'joining' takes place in the ui layer (jsf). Works great and performs great as well.

Other usecases?  Smiley Wink

heymjo
Champ on-the-rise
Champ on-the-rise
yes we cache the user info in a map as well now, works fine. So if you want other cases then use your imagination 🙂

oleksandr
Champ in-the-making
Champ in-the-making
In light of Activiti 6, what do I need to do to use for example Hazelcast instead of RDBMS as storage for my processes?