AnsweredAssumed Answered

Autowiring fileds in a ServiceTask ( ... a class implementing JavaDelegate)

Question asked by johnm on Feb 10, 2015
Latest reply on Mar 12, 2015 by johnm

We are introducing some Activiti flow's into a well established Spring 4.11 project.

A place where we are stumbling is autowiring of existing spring artificacts into java service tasks
We've a handful of java classes implementing JavaDelegate. When we @Autowire a (hibernate dao) for example
(or a mybatis mapper) its null.

We are using spring ( ie context:component-scan ) to scan for various packages looking for @Component.
Everything in the application is being Autowired without issue, except for Activity related objects.

Yes, we have managed to get Spring to inject a bean into our service tasks using spring xml config( as demoed in the "chapter 9" demos of your book), but any further autowired fields that object itself my contain ( and any they may contain..and so on)
are not injected… so we get random nullpointers on various autowired fields.

Are we expected to plumb together all the autowired fields in the applciation context xml?

The documentation is really light here (afaics)…. even the demos in Chapter 9 of the book…

Could you point me to a demonstration app, somewhere that is (persisting  a hibernate dao for example?)
A substantial demonstration of Activiti with spring annotations?

Thanks in advance