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
- Langage dominant
- Java
- Étoiles
- 9.5k
- Forks
- 2.9k
- Merge moyen
- 7 h 8 min
- PR mergées (30 j)
- 2
Description
**Describe the bug**
BpmnModel:

i got this wrong xml:
```
testSimpleValue
```
when i add another xtw.writeEndElement() in writeCustomProperties function ,ServiceTaskXMLConverter class,org.flowable.bpmn.converter package

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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start with ServiceTaskXMLConverter.writeCustomProperties, called during BpmnXMLConverter.convertToXML, and reproduce the issue with the Java snippet in the report on Flowable 6.8.1. Check the generated XML when a ServiceTask has a CustomProperty; done means the extension elements remain inside the serviceTask and the following sequenceFlow, endEvent, and BPMN diagram are emitted at the correct process level.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- backend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100