activiti7 獲取流程定義的xml

夢迴吹角連營發表於2020-07-29
RepositoryService repositoryService = ProcessEngines.getDefaultProcessEngine().getRepositoryService();

//獲取BpmnModel物件
BpmnModel bpmnModel = repositoryService.getBpmnModel(processInstanceId);
//建立轉換物件

BpmnXMLConverter converter = new BpmnXMLConverter();
//把bpmnModel物件轉換成字元
byte[] bytes = converter.convertToXML(bpmnModel);
String xmlContenxt = new String(bytes);

xmlContenxt即為流程的xml

相關文章