It looks like the CamelBehavior class expects a SpringProcessEngineConfiguration, as per below.
Is there any way to get it working in a CDI context?
// Convert it to a SpringProcessEngineConfiguration. If this doesn't work, throw a RuntimeException.
try {
SpringProcessEngineConfiguration springConfiguration = (SpringProcessEngineConfiguration) engineConfiguration;
if (StringUtils.isEmpty(camelContextValue) && camelContextObj == null) {
camelContextValue = springConfiguration.getDefaultCamelContext();
}
// Get the CamelContext object and set the super's member variable.
Object ctx = springConfiguration.getApplicationContext().getBean(camelContextValue);
if (!(ctx instanceof CamelContext)) {
throw new FlowableException("Could not find CamelContext named " + camelContextValue + ".");
The Camel integration runs from the same Spring configuration as the Flowable Engine, that’s why a SpringProcessEngineConfiguration is expected. When using it from a CDI context, you could use Camel in a separate context and communicate via VM queues for example. But then you need to create a custom CamelBehavior to use the VM queues instead of default implementation.
Thanks, I did indeed implement a custom CamelBehaviour and overrode the DefaultActivityBehaviorFactory.
I used the spring option for configuring the CdiJtaProcessEngineConfiguration as per section 16.2.1 in the manual (but hope to remove dependency on spring context).
The behaviour factory actually only needs the class name for the custom behaviour. A small change to the DefaultBehaviorFactory could make the class name a property or a retrievable via a protected method and then the above would be a very small class.
I only created one behaviour implementation for now, instead of the 3 available for spring (not sure about caching the BeanManager:
I wouldn’t mind working on a proper contribution here, but would need some guidance as I am not that familiar with the code base or processes around contributions.