Autowired not working in JavaDelegate


can anybody guide me on following scenario.

I am trying to do some database operation in javadelegate class for my business logic. I am using spring4 with camunda bpm platform(7.7).

Following is piece of code trying to execute.

public class DatabaseLookupProcess implements JavaDelegate {

DatabaseLookupService dbLookupServ;

public void execute(DelegateExecution execution) throws Exception {


In above code i am getting DatabaseLookupService instance as null whereas this is working in non javadelegate class.
Please suggest how to resolve this issue?

Hi @milindk,
how do you link the class from your BPMN model? Are you using Delegate Expression, as described here: ?

I am using delegateclass option and providing qualified classname com.camunda.DatabaseLookupProcess.

This won’t work for version 7.7. But will work in 7.8. See

For now try to use Delegate Expression.

Hi Sdorokhova,

Thanks for guiding me. I have tried few option using Delegate Expression but it is not working.

Do you have any reference where some sample examples given on how to autowired using Delegate Expression. Please share me.


you just have to set the java delegate expression to “#{databaseLookupProcess}”.


Hi @milindk,
I’ve posted you the link to Getting Started. Have you checked it?

IMO it illustrates exactly the same as you want to achieve.

You guys are terrific !!!
Thanks Jerome for quick help. My code is working now.

Also works if you annotate JavaDelegate with @Component

1 Like

Adding @Component worked for me, thanks for posting!