How to use activiti:delegateExpression to wire a spring bean

cancel
Showing results for 
Search instead for 
Did you mean: 
vincent-kali
Established Member

How to use activiti:delegateExpression to wire a spring bean

Jump to solution

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.

1 Solution

Accepted Solutions
vincent-kali
Established Member

Re: How to use activiti:delegateExpression to wire a spring bean

Jump 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 ?

View solution in original post

1 Reply
vincent-kali
Established Member

Re: How to use activiti:delegateExpression to wire a spring bean

Jump 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 ?