简体   繁体   中英

Is there any way to customize rest api of camunda?

We have a standalone camunda instance and a client api endpoint is connected with this instance via rest api calls. I need to customize some rest api of camunda because there are some cases like getting task list and process variables together via rest calls. Getting task list first and then getting process variables for each task doesn't works for me because there will be cases with thousands of tasks.This will cause too much burden on network. Because of some reasons, I can't use embedded version of Camunda so I have to handle this via rest calls. Is there any way to realize this?

I guess you will need to build your own rest API and call Camunda via Java API

Ref 1

Set a customized springboot serlvet context-path,be sure the value isn't "camunda", like this:

server:
  servlet:
    context-path: /workflow

It worked for me.

You can create your own REST API as suggested in previous answers. If you want to extend the CAMUNDA REST API under then same endpoint then this is also possible. However, CAMUNDA does not use Spring for its API, but JAX-RS (Jersey in Spring Boot).

Therefore the registration needs to be done as shown here: https://github.com/rob2universe/camunda-custom-rest-endpoint/blob/main/custom-endpoint/src/main/java/org/camunda/example/api/config/MyResourceConfigCustomizer.java

Then the implementation can look similar to this: https://github.com/rob2universe/camunda-custom-rest-endpoint/blob/main/custom-endpoint/src/main/java/org/camunda/example/api/CustomRestService.java

Even if you implement your own service to create a more efficient query, I would suggest to question the requirements to join full process data on thousands of tasks. This is not a list a human will read through, so maybe a (paginated) search will do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM