Activiti and the REST API

  • June 26, 2013
  • Scott

Congrats to the Activiti team for releasing 5.13, which includes a new REST-API. They redesigned the REST API from scratch, which I think was the right move – thinking about it as a whole instead of separate, independently designed parts:

  • The old API doesn’t cover all features offered by the Java API. The new version covers 99% of all methods in the API services (RuntimeService, RepositoryService, HistoryService, …), which opens up the full potential of the engine through REST. This allows other programing languages to benefit from the power of the Activiti engine.
  • As requirements and use cases came along, the old API grew and evolved. Because of the use-case driven additions, there wasn’t really a common approach followed when adding new REST-calls. This resulted in differences in naming and handling between resources. The new API has introduced a uniform approach.
  • The new API applies the REST-principles more strictly (resource naming, appropriate HTTP-verbs used for resource actions, use of URL’s in responses referencing other resources, using the right HTTP-response codes).

Of course, what we like about it most is how it enables alternate UIs and App embedding possibilities that a clean REST-API enables.  The Activiti team has also done a good job of making sure that you can embed the API in an existing application:

It’s also possible to include the REST-API in your existing application (which may already have an Activiti-engine in it). We tried to make the REST-module (and the other modules as well, by the way) as easy to embed as possible. Just add the activiti-rest.jar as a dependency with all of it’s transitive dependencies and configure the Activiti Restlet Application. If you app runs in a web-container, Restlet is configured as a single servlet. When your application is not in a servlet-environment, you can run a standalone Restlet server to expose the REST-API for your engine.


Related Posts
  • June 13, 2019
  • Ariana

Join us on June 27th at 11 am EST for a webinar with iGrafx, myInvenio & BP3 to discuss the Robotics Journ...

  • May 31, 2019
  • Ariana

BP3 will be sponsoring the Austin Technology Council's Leadership Dinner on Wednesday, June 19, 2019. This eve...

  • April 16, 2019
  • Lance

If you have been thinking about automation or performing small pilots, now is the time to get very serious abo...