这是我正在编写以生成简单的.bpmn文件的代码段

public void testDynamicDeploy() throws Exception {
      BpmnModel model = new BpmnModel();
      Process process = new Process();

      model.addProcess(process);
      process.setId("process");

      process.addFlowElement(createStartEvent());
      process.addFlowElement(createUserTask("task1", "First task", "fred"));
      process.addFlowElement(createUserTask("task2", "Second task", "john"));
      process.addFlowElement(createEndEvent());

      process.addFlowElement(createSequenceFlow("start", "task1"));
      process.addFlowElement(createSequenceFlow("task1", "task2"));
      process.addFlowElement(createSequenceFlow("task2", "end"));

      Pool newPool = ActivitiElements.createPool("LMS", "LMS1");
      newPool.setProcessRef(process.getId());

    Lane lane = ActivitiElements.createLane("Booking1", "Booking");
    lane.getFlowReferences().add("start");
    lane.getFlowReferences().add("task1");
    lane.getFlowReferences().add("task3");
    lane.getFlowReferences().add("end");
    lane.setParentProcess(process);

     process.getLanes().add(lane);

    model.getPools().add(newPool);

   new BpmnAutoLayout(model).execute();

   byte[] xml = new BpmnXMLConverter().convertToXML(model);
   FileUtils.writeByteArrayToFile(targetFile, xml);
}


生成的targetFile文件缺少“ bpmndi:BPMNShape”元素

<participant id="LMS" name="LMS1" processRef="process"></participant>




<lane id="Booking1" name="Booking">


我检查了model.getLocationMap(),其中包含除参与者和通道以外的所有FlowElement GraphicInfo。

请协助解决这个问题

非常感谢

最佳答案

目前无法使用BpmnXMLConverter()。convertToXML(model);

https://community.alfresco.com/thread/231380-bpmndibpmnshape-is-missing-for-participant-and-lane-element-in-xml-when-trying-to-create-pool-and-lane-from-java-source

09-26 21:44
查看更多