Extending Rest Service API

437 views
Skip to first unread message

Martin Spindler

unread,
Mar 26, 2014, 4:37:03 AM3/26/14
to camunda-...@googlegroups.com
Hi everyone,

is it possible to extend the rest services for a certain process engine?

My environment:

Apache Tomcat 7
Spring integration
Rest integration
Camunda engine


Now I want to add some rest services to my process engine, like get all usernames or something like that.


Best regards 

Martin Spindler

Daniel Meyer

unread,
Mar 26, 2014, 4:48:12 AM3/26/14
to camunda-...@googlegroups.com
Hi Martin,

you can
(1) embedd the camunda-engine-rest resources inside your application and
combine them with additial JAX-RS resources
(2) add additional resources to camunda-engine-rest.

Form your description I gather that you are already building a custom
application to which you add camunda / spring / rest etc. and want to
add additional JAX-RS resources to the camunda engine rest Application?
(-> 1)
In that case you have to provide a custom JAX-RS application class in
which you add the camunda resources and your custom resources to the
JAX-RS deployment:
See Example:
http://docs.camunda.org/latest/api-references/rest/#overview-embedding-the-api

Note that with 7.1.0 final you will be able to get the camunda resource
list from a constant:
https://github.com/camunda/camunda-bpm-platform/commit/e863d553cec7cee7a1a7967ed349a427524b4076#diff-bcb4ad0f20d75992354b057307284c90R33

Does this help?

Regards,
Daniel

Martin Spindler

unread,
Mar 26, 2014, 5:39:20 AM3/26/14
to camunda-...@googlegroups.com
Hi Daniel,

I want to do something like this:

class ExampleRestServiceImpl extends UserRestServiceImpl implements ExampleRestService

I exend from UserRestServiceImpl and implement my own Interface where I have special resources. Now I want to access to this resources for example: 

Martin Spindler

unread,
Mar 26, 2014, 5:42:04 AM3/26/14
to camunda-...@googlegroups.com

Martin Spindler

unread,
Mar 26, 2014, 5:42:35 AM3/26/14
to camunda-...@googlegroups.com
Hi Daniel,

I want to do something like this:

class ExampleRestServiceImpl extends UserRestServiceImpl implements ExampleRestService

I exend from UserRestServiceImpl and implement my own Interface where I have special resources. Now I want to access to this resources for example: 
 I always get an error 405 No resource method found for GET

Am Mittwoch, 26. März 2014 10:39:20 UTC+1 schrieb Martin Spindler:

Christian Lipphardt

unread,
Mar 26, 2014, 5:57:02 AM3/26/14
to camunda-...@googlegroups.com
Hi Martin,

You need to register your own resource class inside the JAX-RS
application class and remove the reference to the overwritten class I think.

Cheers,
Christian

Martin Spindler

unread,
Mar 26, 2014, 6:03:59 AM3/26/14
to camunda-...@googlegroups.com
Hi Christian,

I already have registered my resource class as follows:

@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> classes = new HashSet<Class<?>>();
classes.add(ExampleRestServiceImpl.class);
classes.add(ProcessEngineRestServiceImpl.class);
classes.add(JacksonConfigurator.class);

classes.add(JacksonJsonProvider.class);
classes.add(JsonMappingExceptionMapper.class);
classes.add(JsonParseExceptionMapper.class);

classes.add(ProcessEngineExceptionHandler.class);
classes.add(RestExceptionHandler.class);

return classes;
}

Now I don't know what reference to remove?

Regards
Martin

Martin Spindler

unread,
Mar 26, 2014, 7:14:57 AM3/26/14
to camunda-...@googlegroups.com
Hi Daniel,

how can I add additional resources to camunda-engine-rest. You wrote Point (2), but there is no explanation.


Best regards,
Martin

Am Mittwoch, 26. März 2014 09:48:12 UTC+1 schrieb Daniel Meyer:
Reply all
Reply to author
Forward
0 new messages