AnsweredAssumed Answered

Activiti + CDI / Transactions (Timing Issue)

Question asked by joshb1 on Oct 4, 2012
Latest reply on Oct 4, 2012 by joshb1
I am running into a problem - I'm just trying to get Activiti + CDI setup.  I am so close I can taste it, but need to get over this hump.

I have a very simple use case: I am starting a process, and listening using CDI events (@Observes) for certain activities to start and end.  I have an activity that starts after the process starts.  I start my process, and the even is fired and it gets to my method without any problems.  My BusinessProcessEvent object is populated with all the right data.  Once I'm in this method, I want to load the processInstance, or do something, and the instance (and execution) isn't found by the queries.  It looks like it is a timing issue, in that it isn't written to the DB until after the transaction completes.  How should I handle this use case?

Outcomes