Injecting bean into Camunda pre-packaged Tomcat distribution or Camunda Platform Runtime


I am trying to inject beans to be made available to expressions and scripting engine (I mainly use javascript), and was experimenting with both pre-packaged Tomcat distribution and Camunda Platform Runtime.

I followed this example I found online: which provides example of shared common beans as well as local per web-app beans deployed in its own webapp (two webapp in the samples)

The weird thing is, if I do not use pre-deployed bpmn files in the webapp, but I deploy the file directly using Camunda modeler to /engine-rest, then the beans will not be accessible.

I am a bit confused as to how this works. Is there a way to deploy the beans directly into the same shared engine? I am ok putting all the beans into the common tomcat/libs folder. Problem is I have no idea how to get the camunda webapp or the engine-rest webapp to scan for the spring beans.

I did read up on custom deployment, but not very sure without examples how to deploy one that still can have REST API capability as well as the cockpit etc.


Kok Hoor

I find that easiest is to deploy the tomcat war file (which is not standalone) because that has the spring configuration bundled in. From there I added my beans / added bean scanning to appContext.

The challenge next I presume is to add the rest-engine into the same war, but problem with rest is it is not compatible because POST commands will be affected by the CSRF filter.