AnsweredAssumed Answered

The best practise to bind JPA-Entity to process

Question asked by omd on May 5, 2016
Latest reply on May 18, 2016 by jbarrez

I would like to ask you, what is the best way of binding a JPA-Entity to activiti process?
I tried to set bean as a process variable:

variables.put("myBean", myBean);
runtimeService.startProcessInstanceByKey("myProcess", variables);

But this solition has a big drawback. I store the same data in two different places. One is table generated by my entityManager, and second is serialized object variable in activiti DB. The other problem is with querying by fields of my bean, I believe it is so complicated because there is  always need to deserialize a bean before checking values of fields.

Is it possible to store in a process only a reference to my bean ? I could do it by hand by define some map wiring  task id with my bean id.  Maybe there is some mechanism out of box which do this work?

Best Regards.