we are using Camunda as a shared engine on a dedicated tomcat server. We are deploying processes like in “Get started”. Within this WAR files are embedded forms.
What would be an elegant way to get some configurable properties for the task list form? A restart of the system if configuration changes would be acceptable.
I am thinking about an extra configuration app inside the tomcat app which provides configuration information, but actually it is a bit to much overhead. Maybe there is a way to teach Camunda backend to pass some parameters to the tasklist frontend?
Example:
Some forms are loading via $http extra data via REST from another service. I would like to configure the url of this service anywhere, maybe inside the tomcat. Of course, I could set some Java environment props, but they wouldn’t be available in the Angular/Browser context.
EDIT:
I have decided to setup a Spring Zuul proxy server connected to eureka within the >>camunda’s tomcat<< which solves service dispatching.
However, my problem is not solved how to pass some configuration params to the camunda apps like tasklist.
you can have a look at the index.html of the Tasklist. That contains some “magic strings”, which are replaced by the server before sending the file to the client. We use this for example to provide information about which plugins are installed.
You could use a similar mechanism: Add a custom line to the Javascript and replace the value with your configuration information. I think you can do this with maven overlays, but I’m not sure.
sorry, I think I left out an important detail The server does not automatically replace such a magic string. So if you need the user dir in the index.html file, you can use whatever magic string you like, but you have to make sure that you implement the string replacement in Java.
You can have a look at the ProcessEnginesFilter.java file in the webapp repository. There we replace the strings for our magic variables like $APP_ROOT or $PLUGIN_PACKAGES. You could add your magic strings and replacements to this file and rebuild the webapp to get the changes.
I have to admit that I have just realized now (with your hints) that those “process applications” are simple web application where I am free to add any other technologies. So, I have switched to a Spring Boot application with Thymeleaf (which is our preferred stack anyway) where the forms aren’t static html anymore but dynamically generated. Then I can add anything comfortable server side.
Best Regards,
Michael
(Written this answer for other member which have similar problems)
Can you please share how to integrate with Eureka? I’m planning to do the similar thing: integrate with Eureka, Zuul. But I’d like to find some reference how we integrate the Camunda engine/rest to Eureka.