cancel
Showing results for 
Search instead for 
Did you mean: 

REST revisited (JAX-RS and JAXB)

tstephen
Champ on-the-rise
Champ on-the-rise
I realise that last year the feeling was that there were more important things to work on that a revised REST implementation but I wondered if now might be a good time to revisit that?

First a bit about motivations. I think there would be benefits in terms of more seamlessly and automatically generating a RESTful API from the existing Activiti API (RepositoryService, RuntimeService etc.) as well as other advantages in terms of generating documentation

Another motivation, or perhaps just a different way of saying the same one, is to make Activiti 'natively' RESTful. In other words, presentation as XML / JSON for machine consumption or HTML for human consumption is orthogonal to the resource being requested. Thus concerns are separated and transport is transparent. In practical terms it would be possible to have a single webapp instead of activiti-webapp-explorer2 and activiti-webapp-rest2

This would require that the *Service classes are annotated and the various model beans (Deployment, ProcessDefinition, ProcessInstance etc.) are serialisable as JSON and / or XML (more annotations). I recognise that the model beans contain quite a lot of behaviour that may make simply annotating them quite painful in practice but let's leave that aside for now.

I think the basic set of resources looks like this (new methods are marked with a *):

Method    Path                                           POJO                      Method
PUT         /repository/{resourceName}       RepositoryService  * deploy(String resourceName, String text)
GET         /repository/deployment/{id}        RepositoryService  getDeploymentResourceNames
DELETE   /repository/deployment/{id}        RepositoryService  deleteDeployment

Well you get the idea… The basic set is available in my github fork: https://github.com/tstephen/Activiti

You'll notice this is not the full set of public methods on the service classes. In some (few, I think) cases there are methods that don't lend themselves well to REST patterns but for the most part I just chose a minimal subset to get started with and to see what other people think about the idea.

The new behaviour does not work yet but you can explore the source code impact. All previous behaviour should be completely unchanged but I have done no regression testing at this point.

I look forward to your ideas.
Tim
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi Tim,

We are working on a full REST API that mirrors the Java API for the 5.13 release.
This means that we are implementing the REST API in a similar way like you describe here, but it's implemented as a layer on top of the Java API. Because our response objects like Task, and Execution are basically wrappers around TaskEntity and ExecutionEntity it's good to have this additional layer to prevent attributes leaking in the REST response.

Because our time frame for the 5.13 is pretty short, we decided to implement the REST layer with Restlet, just like we did in the previous REST implementation. Then after 5.13, we have time to decide on which implementation is best for the future and we would very much welcome your input there. But at least we will have a full REST API available in the 5.13 release and the implementation is of secondary importance I guess.

Best regards,

tstephen
Champ on-the-rise
Champ on-the-rise
Thanks for the reply Tijs.

Is this the API you refer to?: https://github.com/activiti/Activiti/tree/master/modules/activiti-rest/src/main/java/org/activiti/re...

Where can I see the plan for 5.13 (the roadmap page still refers to 5.11 as the current release)?

Cheers,
Tim

trademak
Star Contributor
Star Contributor
Hi Tim,

Yes, that's the correct location. The plan for 5.13 is available here:

https://github.com/Activiti/Activiti/wiki/Activiti-roadmap

Best regards,

tstephen
Champ on-the-rise
Champ on-the-rise
Is there a target date for the 5.13 release?

jbarrez
Star Contributor
Star Contributor
@Tim: first week of June if all goes well. Might be a bit later this time, cause we want to squeeze in some new stuff.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.