Camunda Team Blog

A look at the fresh REST API

Written by Thorben Lindhauer on , under Execution category.
camunda BPM comes with a fresh REST API based on JAX-RS. Its goal is to expose the process engine services as broadly as possible. That means we aim to enable you to interact with process engine services via REST with similar expressiveness as in plain Java. With 7.0.0-alpha1, we provide methods such as task querying that already realize our desired degree of detail (similar for process definitions and instances). For future releases, we plan to broaden the scope to reach the afore-mentioned goal.

Use it with a prebuilt distro

In 7.0.0-alpha1 the API covers interactions with process definitions, process instances and tasks as documented on camunda.org. Enough to build your first process applications as demonstrated in camunda's tasklist. In our prebuilt distros, the REST API is enabled by default and is ready to go.

Cool feature: camunda's cockpit prototype uses the new methods for aggregated runtime statistics. These give you the number of running instances of BPMN concepts such as processes and activities grouped by process definition and activity respectively. Optionally you can also get the number of failed jobs.

You may also address the several process engines you are running on the platform by prepending /engine/{engine-name} to any of the method's urls. If you omit this, the default engine is used.

Embed it in your own JAX-RS application

Got your embedded engine and want to quickly add REST capabilities to it? You may embed the RESTful resources in your own JAX-RS application with little configuration if you run on Resteasy and have jackson-jaxrs on your classpath. Pick up the REST resources by adding the following Maven dependency:
<dependency>
<groupid>org.camunda.bpm</groupid>
<artifactid>camunda-engine-rest</artifactid>
<classifier>classes</classifier>
<version>7.0.0-alpha1</version>
</dependency>

Then you can choose which of the resources you want to include. Have a look here to see how this can be done. (The alternative is to use a JAX-RS implementation provided by your application server.)

Being an alpha release, we are aware that essential features such as authentication are still missing. However, this is on our roadmap to 7.0.0 final, so stay tuned and explore the docs meanwhile!