cancel
Showing results for 
Search instead for 
Did you mean: 

Use of Spring service tasks from Activiti Explorer

mdaviot
Champ in-the-making
Champ in-the-making
Hi,

I had previously a question about the use of Spring beans in services tasks.

But actually I need to use these beans from the Activiti Explorer. The idea is to make a simple production followup GUI for the production team using Activiti Explorer so they can see processes in error and with a user task retry the service tasks which failed.

When I execute a service task implement with a Spring bean from Activiti Explorer, I get again this org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'myService' as in my previous post.

I had a look at the source code for StartProcessInstanceClickListener, and I see that runtimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService(); … exactly what would cause this problem as was said in the previous post.


So in short my questions :
- is it possible to use Spring beans to implement a service task triggered from the Activiti Explorer as it is currently ?
- If yes, what could go wrong in my case ? The code source is available here on dropbox.

Thanks and regards
Michel
11 REPLIES 11

mdaviot
Champ in-the-making
Champ in-the-making
ProcessEngines.getDefaultProcessEngine() -> this will also work when the engine is wired in spring. Once ANY engine starts, it get's registered with the ProcessEngines object. The explorer-app engine has no explicit name set (/activiti-webapp-explorer2/src/main/webapp/WEB-INF/applicationContext.xml), so the default is used, effectively exposing it as the default.

So the engine obtained should be the correct one. Every bean you wire in applicationContext.xml, should be available in expressions…

Actually, I think I have found a bug here. JIRA created : http://jira.codehaus.org/browse/ACT-1420

jbarrez
Star Contributor
Star Contributor
Thanks for creating the issue. I need to have a think about what would be the correct behavior actually … but I agree it is confusing at the moment.