Integration with Google Guice

Hi guys,

is it possible to use Google Guice for dependency injection within a Camunda process application? How would I do that?

What I want to achieve is to be able to inject some utility classes into my JavaDelegate classes. Like this:

public class MyTaskDelegate implements JavaDelegate {
    private MailSender mailSender;

    public void execute(final DelegateExecution execution) throws Exception {




Any clues?


Ik you run Camunda in an Application Server, you can use Delegate Expressions. Named beans that implement the JavaDelegate interface.

No need for Google Guice.

Thank you for your response.

However we are running Camunda on Tomcat so I’m looking for a Non-EJB solution.

Are you amenable to use of Spring?

I guess it is doable with Guice or Weld as there is an open support ticket in the Camunda sprint backlog to document it.

I’d like to avoid using Spring :sunglasses:
It’s just a small and lightweight application and besides Dependency Injection there is no need for any other framework.

Hi Frank,

If you aren’t tied to GG, you can use Weld on Tomcat. Just google on how to bootstrap Weld inside Tomcat, then you just need to add the camunda-engine-cdi.jar to your ProcessApplication and it should work.
Basically we do the same in our QA integration testsuite for Tomcat.
We add Weld to each ProcessApplication deployment in our testsuite for the shared process engine on Tomcat like that:

  1. Add the Weld libraries to the deployment, specifically for Tomcat the weld-servlet. Maven coordinates org.jboss.weld.servlet:weld-servlet
  2. Add a context.xml file to the process application referencing the Weld BeanManager -
  3. Bootstrapping Weld for each ProcessApplication by adding the following marked lines to the web.xml -


1 Like

Sounds great, I will try this. Thank you!