camunda-community-hub / camunda-platform-7-camel

Community Extension to add Apache Camel support for Camunda Platform 7
Apache License 2.0
82 stars 57 forks source link

camunda-bpm-camel in spring-boot : Cannot find property camel #31

Open larbigj opened 7 years ago

larbigj commented 7 years ago

I have a spring boot application with camel and camunda integration.

https://github.com/larbigj/camunda-camel-boot

I can start a camunda process with a camel route but when I try to call a camel route from the process I get an exception org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException: Cannot find property camel

A bean with name camel as mentioned in the documentation is available

@Bean(name = "camel") public CamelServiceImpl camel() { CamelServiceImpl camelServiceImpl = new CamelServiceImpl(); camelServiceImpl.setCamelContext(camelContext); camelServiceImpl.setProcessEngine(processEngine); return camelServiceImpl; }

Regards Jörg

larbigj commented 7 years ago

Add the bean to the spring process engine config did it !

` @Bean CamelContextConfiguration nameConfiguration() { return new CamelContextConfiguration() { @Override public void beforeApplicationStart(CamelContext camelContext) { CamundaBpmComponent component = new CamundaBpmComponent(processEngine); SpringProcessEngineConfiguration config = (SpringProcessEngineConfiguration)processEngine.getProcessEngineConfiguration(); config.getBeans().put("camel", camel()); camelContext.addComponent("camunda-bpm", component); }

        @Override
        public void afterApplicationStart(CamelContext arg0) {

        }
    };
}

`

larbigj commented 7 years ago

Should be part of the documentation