Activiti 5.22. Should I be able to access a different process engine from within an execution or event listener.

cancel
Showing results for 
Search instead for 
Did you mean: 
pault
Active Member II

Activiti 5.22. Should I be able to access a different process engine from within an execution or event listener.

I am currently moving some code from 5.0 to 5.22 on its way to 6 then 7.  I use execution/event listeners and these sometimes need to interact with a process engine other than the one which is creating the events.

I can find the engine I want with ProceesEngines.getProcessEngine(), and i can also get what look like the correct services, e.g. repository service. However when I create a query from the service, e.g. to list deployments, I get the results for the engine that created the event, rather than the one I just looked up. The same piece of code outside of the listener works fine.   

This did work as i was expecting in 5.0, but not sure if I am doing something wrong or unsupported. 

1 Reply
pault
Active Member II

Re: Activiti 5.22. Should I be able to access a different process engine from within an execution or event listener.

On checking my old notes,  using the API from within a listener was noted as 'not advised' - as it had not been fully tested. Looks like that is still the case, but now different things don't work as expected.

Moving my stuff to it's own thread sorts it out, and I needed to do that ultimately anyway.  So will mark this as answered.