gpt4 book ai didi

java - 我无法将 camunda map 元素作为输入参数的子元素。无法理解为什么?

转载 作者:行者123 更新时间:2023-11-30 06:17:50 26 4
gpt4 key购买 nike

代码旋转网:

                CamundaInputParameter camundaInputParameter2=createElement(camundaInputOutput, CamundaInputParameter.class);
camundaInputParameter2.setCamundaName("headers");

CamundaMap camundamap = createElement(camundaInputParameter2, CamundaMap.class);
CamundaEntry camundaentry = createElement(camundamap, CamundaEntry.class);
camundaentry.setCamundaKey("Accept");
camundaentry.setTextContent("application/json");

JSON 响应:

{ “时间戳”:1518705529135, “状态”:500, "error": "内部服务器错误", "异常": "org.camunda.bpm.model.xml.ModelException", "message": "新子元素不是有效的子元素类型:map;有效类型为:[]", “路径”:“/camunda/updateWorkflow/”

最佳答案

嗯,我也面临着同样的问题。根据 Camunda 文档:https://docs.camunda.org/manual/7.6/reference/bpmn20/custom-extensions/extension-elements/#inputparametermap 元素位于 inputParameter 的子元素列表中,因此它应该可以工作,但事实并非如此。解决方法是:

    CamundaInputParameter headers = model.newInstance(CamundaInputParameter.class);
headers.setCamundaName("headers");

CamundaMap map = model.newInstance(CamundaMap.class);
CamundaEntry entry = model.newInstance(CamundaEntry.class);
entry.setCamundaKey("Content-Type");
entry.setTextContent("application/json");
map.addChildElement(entry);
//headers.addChildElement(map); does not work
headers.getDomElement().appendChild(map.getDomElement()); // works

关于java - 我无法将 camunda map 元素作为输入参数的子元素。无法理解为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48810059/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com