cancel
Showing results for 
Search instead for 
Did you mean: 

How to control processengine startup when using cdi

arc
Champ in-the-making
Champ in-the-making
We are using activiti with cdi (to be able to get EJBs into our delegate classes).

But now we have a problem that cdi makes the activiti engine start before all EJBs are ready.
Then if there are server task jobs (in act_ru_job) that has a historic due date,  the server task delegate classes will be called before the EJBs is up and running. And since most of our delegate classes use EJBs we run into problems.

Is there any way to control the activiti engine startup when using cdi?
We would like to start activiti from our @Startup annotated EJB.
1 REPLY 1

k5
Champ in-the-making
Champ in-the-making
we had a similar problem.
We solved it by making the org.activiti.cdi.spi.ProcessEngineLookup return a LazyProcessEngine, that only initializes the actual engine when used. That will delay the activiti startup long enough for the @EJB being initialized.