Hi,
In my current process application, I would like to retrieve some backend data to be shown in the first form.
The first form is shown before a new process instance has been created, so I cannot use any delegate for retrieving the required data.
My first idea on solving this matter would be to get the data by using a REST Service from the form directly with AngularJS.
But then I was wondering: if I implement the REST Service for this application, how could we deliver / deploy it? Currently we are deploying a single application WAR file into a Tomcat Server.
So here are my questions:
- Is there a way of creating new REST services within a Camunda Application? Like packaging everything in one WAR file at the end? - Or do the customized REST services have to be managed outside the Camunda application package?
PS: I know that it is possible to extend the Camuinda REST API, but this is not what I want to do, because the services will be specific for one single application.
You could simply bundle a JAX-RS provider with your WAR. For example, Camunda ships RestEasy as JAX-RS provider with our WebApp and Rest API on Tomcat. Then you can just create a standard JAX-RS application class inside your WAR and expose the necessary services over REST. Those can then be called from the forms using AngularJS.
Edit: A Camunda application is nothing more than a WAR with some Camunda stuff in it. Everything what you can do with a WAR can be done.
If you use Spring, create a spring bean, annotate methods to be exposed as web services and you will thus have an API relative to your application deployment.
When you do this, is the Camunda authentication used? Or do I need to implement authentication? Could anyone post a sample of a class which implements a REST endpoint in a Camunda WAR, please? (I’m new to both Camunda and Java).