由于群里有些朋友对这个flowable还不是 很熟悉,在群里的小伙伴的建议下,师傅(小学生05101)制作一个开源的项目源码,一共大家学习和交流,希望对有帮助,少走弯路 如果有不懂的问题可以入群:633168411 里面都是一些热心肠的人。
项目地址 https://gitee.com/lwj/flowable.git 代码分支 flowable-base 视频讲解地址 https://space.bilibili.com/485524575/channel/detail?cid=94579
用户名 密码 0000001 test 0000002 test 0000003 test 0000004 test
1. 演示
2. 查看xml代码
public void loadXmlByModelId(@PathVariable String modelId, HttpServletResponse response) {try {Model model = modelService.getModel(modelId);byte[] b = modelService.getBpmnXML(model);response.setHeader("Content-type", "text/xml;charset=UTF-8");response.getOutputStream().write(b);} catch (Exception e) {LOGGER.error("ApiFlowableModelResource-loadXmlByModelId:" + e);e.printStackTrace();}}
3. 查看图片
public void loadPngByModelId(@PathVariable String modelId, HttpServletResponse response) {Model model = modelService.getModel(modelId);BpmnModel bpmnModel = modelService.getBpmnModel(model, new HashMap<>(), new HashMap<>());InputStream is = flowProcessDiagramGenerator.generateDiagram(bpmnModel);try {response.setHeader("Content-Type", "image/png");byte[] b = new byte[1024];int len;while ((len = is.read(b, 0, 1024)) != -1) {response.getOutputStream().write(b, 0, len);}} catch (Exception e) {LOGGER.error("ApiFlowableModelResource-loadPngByModelId:" + e);e.printStackTrace();}}