flowable / flowable/flowable-engine

When I use the convertToXML method of BpmnXMLConverter to convert BpmnModel into an XML file, if the ServiceTask defines setCustoms Properties, the converted XML file has problems

Aperta
#3,977 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

**Describe the bug**
BpmnModel:

![image](https://github.com/user-attachments/assets/2366ff1a-a918-44be-a8b3-17745e043b3e)

i got this wrong xml:

```







testSimpleValue









```

when i add another xtw.writeEndElement() in writeCustomProperties function ,ServiceTaskXMLConverter class,org.flowable.bpmn.converter package
![image](https://github.com/user-attachments/assets/7d987c39-8344-4a01-83fa-4fc1540619d7)

I got xml that looks correct

```







testSimpleValue








```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Code**

```java

@Test
void contextLoads() {

BpmnModel bpmnModel=new BpmnModel();
ServiceTask serviceTask=new ServiceTask();

ArrayList customProperties = new ArrayList<>();
CustomProperty customPropertyRole = new CustomProperty();
customPropertyRole.setName("flowable:test");
customPropertyRole.setSimpleValue("testSimpleValue");
customProperties.add(customPropertyRole);
serviceTask.setCustomProperties(customProperties);
serviceTask.setId("serviceTask");

Process process = new Process();
StartEvent startEvent = new StartEvent();
startEvent.setId("start");
startEvent.setName("开始");
startEvent.setFormKey("11111");

process.addFlowElement(startEvent);
SequenceFlow sequenceFlow = new SequenceFlow();
sequenceFlow.setSourceRef("start");
sequenceFlow.setTargetRef("serviceTask");
process.addFlowElement(sequenceFlow);
process.addFlowElement(serviceTask);

EndEvent endEvent = new EndEvent();
endEvent.setId("end");
endEvent.setName("结束");

SequenceFlow sequenceFlow2 = new SequenceFlow();
sequenceFlow2.setSourceRef("serviceTask");
sequenceFlow2.setTargetRef("end");

process.addFlowElement(sequenceFlow2);
process.addFlowElement(endEvent);
process.setName("process");
process.setId("processid");
bpmnModel.addProcess(process);

BpmnXMLConverter xmlConverter = new BpmnXMLConverter();
String writer = StrUtil.utf8Str(xmlConverter.convertToXML(bpmnModel));
System.out.println(writer);

}
```

**Additional context**
Add the version of Flowable that you are using, the database vendor and if you are using Flowable within Spring Boot, the Flowable Task application etc.

flowable:6.8.1

database:mysql-8.0

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.