Storing process variables in own tables

Hello :slight_smile:
I’am new on camunda and we have to modelling and implement several processes. So we will also have many variables to store.
Thats why we thougt about to store the variables in own tables where we can also use constraints and where we have the possibility to find the variable fast in the database. But we have problems to do a relationship from our entity to the process definition. We are using Hibernate JPA.
Is there a way to do that?
Or what is the best practice to store and validate the variables?

1 Like

Hello

My personal recommendation is to keep the Camunda process related data and you ‘business data’ separate. We stored our data in our database/schema and linked the business data with the Camunda business key. You can save the data any time during the bpmn process but at least in the end of the process.

Our you can store only the id of the entities in Camunda process and look for the business data when you need.

Regards: Gábor

Hello Gábor

Thank you for your reply.
How did you do the relationship between your data table and the business key? Hibernate have a problem if we try to link the Camunda process to the business entity, because we can not set the hibernate annotation in the camunda entity.
Did you manage the relationship manually?

Regards
Agnes

Hello

We stored separately the business data. Tere was only an extra column for the businesskey.

Regards Gábor

Hello Gabor!
The reply is quite old, but we currently have the same use case. We need to store our bussiness data in different table. But we are not sure how to tell Camunda to save and load the data from our table. Have you used the listeners to hook into the process and load you business data or is there different approach for that?

Thanks,
Laman.

Hello

I really don’t think that is a good way to go about this.
Please see my other reply How to store references only in Camunda - #2 by mimaom regarding this.

BR
Michael