Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem 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

Đang mở
#3,977 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với ServiceTaskXMLConverter.writeCustomProperties, được gọi trong quá trình BpmnXMLConverter.convertToXML, và tái hiện vấn đề bằng đoạn mã Java trong báo cáo trên Flowable 6.8.1. Kiểm tra XML được tạo khi một ServiceTask có một CustomProperty; hoàn tất khi các phần tử mở rộng vẫn nằm bên trong serviceTask và sequenceFlow, endEvent cùng sơ đồ BPMN tiếp theo được xuất ở cấp quy trình chính xác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
9.6k
Fork
2.9k
Merge trung bình
1 giờ 9 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của flowable/flowable-engine

Tất cả issue của flowable/flowable-engine

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.