Activiti 6 Use custom bean in listener

cancel
Showing results for 
Search instead for 
Did you mean: 
sanjaybandhniya
Intermediate

Activiti 6 Use custom bean in listener

I am using activiti 6.

I want to configure custom bean which will be used in tasklistener.

Where I can register ?

Other issue is how can I get member os group in TaskListner?

Autowired service is not working in activiti.

public class CreateTask implements TaskListener {
}

 

2 Replies
openpj
Moderator
Moderator

Re: Activiti 6 Use custom bean in listener

If you are using the attribute activiti:class, it doesn't resolve the wiring of Spring beans.

In order to enable the wiring for your Spring beans, you have to declare it using the attribute activiti:delegateExpression setting its own Spring Bean Id such as the following:

<serviceTask id="thisIsMyServiceTaskId"
name="Service Task that needs Autowiring" activiti:delegateExpression="${myServiceTaskSpringBeanId}"/>

You can find a complete example in the following tutorial:

https://hub.alfresco.com/t5/alfresco-process-services/activiti-enterprise-developer-series-service-t...

Hope this helps Smiley Wink

sanjaybandhniya
Intermediate

Re: Activiti 6 Use custom bean in listener

I am using activiti community version,not enterprise.

What ever you have suggested that is applicable to enterprise version only and tasklistner is on user task.