activiti 获取部署的图片为什么和我画的流程图有差别?是什么问题呢? 5C

//查询model信息
Model modelData = repositoryService.createModelQuery().modelKey(id).singleResult();
BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
//获取数据表信息
JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode);
BpmnXMLConverter xmlConverter = new BpmnXMLConverter();
byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel);
//部署流程
String processName = modelData.getId() + ".bpmn20.xml";
Deployment deployment = repositoryService.createDeployment().name(modelData.getId()).addString(processName, new String(bpmnBytes,"utf-8")).deploy();

//查询流程定义图片
if(deployment != null){
List pList = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey("process").list();
ProcessDefinition processDefinition = null;
for (ProcessDefinition pd : pList) {
if(pd.getDeploymentId().equals(deployment.getId())){
processDefinition = pd;
}
}

String diagramResourceName = processDefinition.getDiagramResourceName();
InputStream in = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), diagramResourceName);

//将图片生成到D盘的目录下
File file = new File("D:/"+diagramResourceName+".png");
//将输入流的图片写到D盘下
FileUtils.copyInputStreamToFile(in, file);
//删除部署
repositoryService.deleteDeployment(deployment.getId(), true);

// return in;
}

图片说明
图片说明

1个回答

字体的问题。设成仿宋,试试。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐