简体   繁体   English

camunda的rest api有什么方法可以定制吗?

[英]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.我们有一个独立的 camunda 实例,并且客户端 api 端点通过 rest api 调用与此实例连接。 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.我需要定制一些 rest api of camunda 因为在某些情况下,例如通过 rest 调用一起获取任务列表和流程变量。 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.由于某些原因,我不能使用 Camunda 的嵌入式版本,所以我必须通过 rest 调用来处理这个问题。 Is there any way to realize this?有没有办法实现这一点?

I guess you will need to build your own rest API and call Camunda via Java API我想您将需要构建自己的 rest API 并通过 Java ZDB974278714CA8ACE14D4 呼叫 Camunda

Ref 1 参考 1

Set a customized springboot serlvet context-path,be sure the value isn't "camunda", like this:设置一个自定义的springboot serlvet context-path,确保值不是“camunda”,像这样:

server:
  servlet:
    context-path: /workflow

It worked for me.它对我有用。

You can create your own REST API as suggested in previous answers.您可以按照先前答案中的建议创建自己的 REST API 。 If you want to extend the CAMUNDA REST API under then same endpoint then this is also possible.如果您想在同一端点下扩展 CAMUNDA REST API,那么这也是可能的。 However, CAMUNDA does not use Spring for its API, but JAX-RS (Jersey in Spring Boot).但是,CAMUNDA 的 API 并没有使用 Spring,而是使用 JAX-RS(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因此,需要按照此处所示进行注册: 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然后实现看起来类似于这样: 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.这不是人类会阅读的列表,因此(分页)搜索可能会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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