使用REST的Camunda GET XOR Gateway的机会 [英] Camunda GET opportunities of XOR Gateway using REST

查看:138
本文介绍了使用REST的Camunda GET XOR Gateway的机会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情况:

我想做的是在Angular应用程序中获得一个下拉菜单,其中列出了所有书籍的机会.因此,我可以在哈利波特",白鲸"和鲁滨逊漂流记"之间进行选择.当我选择一本书并按提交时,我会通过REST发送POST /complete .

What i want to do is to get a dropdown menu in my Angular application where all opportunities of books are listed. So i can choose between 'Harry Potter', 'Moby Dick' and 'Robinson Crusoe'. When i selected one book and press submit i send a POST /complete via REST.

它应该看起来像这样,因此选项应始终与Camunda模型中的相同:

It should look like this, whereby the options should always be the same like in the Camunda Model:

我在这里的问题是:如何获得我可以通过REST选择哪些书的信息?甚至有可能吗,应该怎么做?

My questions here are: how can i get the information which books i can choose via REST? Is that even possible and is that how it should be done?

推荐答案

有一个选项可能会对您有所帮助.这个想法是获得流程定义的BPMN 2.0 XML.您可以解析xml并获取网关或任何元素.

There is one option that might help you. The idea is to get the BPMN 2.0 XML of a process definition. And you can parse the xml and get the gateways or any element.

标准结果是一个转义的XML字符串,其中包含部署此定义的XML.

The standard result is a an escaped XML string containing the XML that this definition was deployed with.

Camunda的API具有以下端点/process-definition/{id}/xml .它返回流程定义的 BPMN 2.0 XML.

Camunda's API has the following endpoint /process-definition/{id}/xml. It returns the BPMN 2.0 XML of the process defition.

添加了其他端点,

返回不属于任何租户的最新版本的流程定义的XML

Returns the XML for the latest version of the process definition which belongs to no tenant

获取/process-definition/key/{key}/xml

为租户返回最新版本的流程定义的XML

Return the XML for the latest version of the process definition for tenant

获取/process-definition/key/{key}/tenant-id/{tenant-id}/xml

请求

http://localhost:5115/engine-rest/process-definition/Process_16yhb92:1:1605d9ef-be29-11ea-a3af-0242ac160003/xml

您的XML应该如下所示:

Your XML should look like the following:

"bpmn20Xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" id=\"Definitions_0tnus7x\" targetNamespace=\"http://bpmn.io/schema/bpmn\" exporter=\"Camunda Modeler\" exporterVersion=\"3.5.0\">\n  <bpmn:process id=\"Process_16yhb92\" isExecutable=\"true\">\n    <bpmn:startEvent id=\"StartEvent_1\">\n      <bpmn:outgoing>SequenceFlow_05h0ut0</bpmn:outgoing>\n    </bpmn:startEvent>\n    **<bpmn:exclusiveGateway id=\"ExclusiveGateway_1\">\n**      
...
...
sourceRef=\"Task_1mivaws\" targetRef=\"ExclusiveGateway_1\" />\n 

这篇关于使用REST的Camunda GET XOR Gateway的机会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆