Configuring Camunda with Spring without ProcessApplication

168 views
Skip to first unread message

mih...@gmail.com

unread,
Sep 17, 2015, 6:32:02 AM9/17/15
to camunda BPM users
I'm having troubles setting up Camunda as an embedded process engine in a Spring application.

I started with official Java Config example (https://github.com/camunda/camunda-consulting/tree/master/snippets/spring-java-based-config) and dropped ProcessApplicationBean. With SpringProcessEngineConfiguration.deploymentResources set, I am able to start processes and the engine works fine.

The problem occurs when I want a service task to call a Spring Bean by setting delegateExpression according to examples. Camunda doesn't see any beans. I tried setting SpringProcessEngineConfiguration.setBeans() explicitly with the bean I'm trying to call, but I get an error that the bean is not JavaDelegate, although it is.

What am I missing? What additional steps does SpringProcessApplication do to make everything work?

thorben....@camunda.com

unread,
Sep 18, 2015, 2:39:10 AM9/18/15
to camunda BPM users, mih...@gmail.com
Hi,

I suggest you have a look at the Spring getting-started guide [1] and its source code [2].

Cheers,
Thorben

[1] http://docs.camunda.org/get-started/spring/
[2] https://github.com/camunda/camunda-get-started-spring/

mih...@gmail.com

unread,
Sep 18, 2015, 8:26:22 AM9/18/15
to camunda BPM users, mih...@gmail.com
Thanks, Thorben. Your answer has actually helped.

What I was missing was ProcessEngineFactoryBean. Before, I was instantiating ProcessEngine by calling SpringProcessEngineConfiguration.buildProcessEngine() directly. I should have used ProcessEngineFactoryBean, because it is aware of application context and can do the right initialization stuff.

Reply all
Reply to author
Forward
0 new messages