Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Inizia con ServiceTaskXMLConverter.writeCustomProperties, chiamato durante BpmnXMLConverter.convertToXML, e riproduci il problema con lo snippet Java riportato nella segnalazione su Flowable 6.8.1. Controlla l’XML generato quando una ServiceTask ha una CustomProperty; il lavoro è completato quando gli elementi di estensione rimangono all’interno della serviceTask e il sequenceFlow, l’endEvent e il diagramma BPMN seguenti vengono emessi al livello di processo corretto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
BpmnModel:

image

i got this wrong xml:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/test">
  <process id="processid" name="process" isExecutable="true">
    <startEvent id="start" name="开始" flowable:formKey="11111"></startEvent>
    <sequenceFlow sourceRef="start" targetRef="serviceTask"></sequenceFlow>
    <serviceTask id="serviceTask">
      <extensionElements>
        <flowable:field name="flowable:test">
          <flowable:string>testSimpleValue</flowable:string>
        </flowable:field>
      </extensionElements>
      <sequenceFlow sourceRef="serviceTask" targetRef="end"></sequenceFlow>
      <endEvent id="end" name="结束"></endEvent>
    </serviceTask>
    <bpmndi:BPMNDiagram id="BPMNDiagram_processid">
      <bpmndi:BPMNPlane bpmnElement="processid" id="BPMNPlane_processid"></bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>
  </process></definitions>

when i add another xtw.writeEndElement() in writeCustomProperties function ,ServiceTaskXMLConverter class,org.flowable.bpmn.converter package
image

I got xml that looks correct

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/test">
  <process id="processid" name="process" isExecutable="true">
    <startEvent id="start" name="开始" flowable:formKey="11111"></startEvent>
    <sequenceFlow sourceRef="start" targetRef="serviceTask"></sequenceFlow>
    <serviceTask id="serviceTask">
      <extensionElements>
        <flowable:field name="flowable:test">
          <flowable:string>testSimpleValue</flowable:string>
        </flowable:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow sourceRef="serviceTask" targetRef="end"></sequenceFlow>
    <endEvent id="end" name="结束"></endEvent>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_processid">
    <bpmndi:BPMNPlane bpmnElement="processid" id="BPMNPlane_processid"></bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

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

Code


@Test
    void contextLoads() {

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

        ArrayList<CustomProperty> 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

Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
1h 9m
PR unite (30g)
2

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flowable/flowable-engine

Tutte le issue di flowable/flowable-engine

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.