cancel
Showing results for 
Search instead for 
Did you mean: 

Persisting to a Custom Table

taher
Champ in-the-making
Champ in-the-making
I am trying to use Activiti to persist to one of my custom tables using the built in functionality.

I am building a workflow process. The process and my business data needs to be in sync. I have tried to achieve this using the example from the Activiti in Action book ( 6.3.2 Implementing a process with JPA extensions).

The object that I am tryings to save is being serialised and saved into Activiti tables. I can confirm that I can retrieve this object but I do not want to save the java object. I want it to create / update a custom business table in the database. I though that this is what the example in the book was all about.

After reading various posts, it has become unclear if this is possible. I have read that I would need to link the Activiti process with my custom business tables using a "reference variable" technique.

Can I use an Activiti process to persist to my custom tables? 
1 REPLY 1

ollib
Champ in-the-making
Champ in-the-making
take a look at chapter 10 of the user guide.

the trick is to define a jpa entity.

when your process starts, create an instance of this entity in a service task and save it in the database and in an activiti result variable. this result variable is stored in act_ru_variable (and act_hi_varinst). the type_ column will contain the string "jpa-entity" and the text_ column will contain the class name of your your jpa entity class. text_2 will contain the id of the entity. with this information activiti seems to be able to instantiate the object later.

hope this helps.

oliver