I want to use a Spring bean as a java-delegate in my Service task.
The java-delegate is defined in Spring context file:
<bean id="myJavaDelegateId" class="my.package.myJavaDelegate" init-method="init">
</bean>
Task is defined in BPMN this way:
<serviceTask id="myServiceTask" name="My Task" activiti:delegateExpression="myJavaDelegateId">
</serviceTask>
When task is executed, I got the following error:
"Delegate expression myJavaDelegateId did neither resolve to an implementation of interface org.activiti.engine.impl.pvm.delegate.ActivityBehavior nor interface org.activiti.engine.delegate.JavaDelegate"
It seems that the Spring bean is not resolved at runtime (I got the same result when using a fake bean id in BPMN).
Any idea ?
Thanks.
Solved! Go to Solution.
Here is the solution:
https://stackoverflow.com/questions/7899790/calling-spring-bean-from-alfresco-activiti-process
Bean id must be added to the config of activitiBeanRegistry that define the list of visible beans in expressions.
I did not found anything about this in activiti doc.
Is this needed only when activiti is integrated into Alfresco repo ?
Here is the solution:
https://stackoverflow.com/questions/7899790/calling-spring-bean-from-alfresco-activiti-process
Bean id must be added to the config of activitiBeanRegistry that define the list of visible beans in expressions.
I did not found anything about this in activiti doc.
Is this needed only when activiti is integrated into Alfresco repo ?
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.