Activiti 5.18 流程Model 转成 流程BPMN文件

直接上代码吧

        byte[] bpmnBytes = null;
        String filename = null;
        JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelId));
        BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
        BpmnModel model = jsonConverter.convertToBpmnModel(editorNode);
        filename = model.getMainProcess().getId() + ".bpmn20.xml";
        bpmnBytes = new BpmnXMLConverter().convertToXML(model);
        
        ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes);

字节流in中包含着已经转成bpmn文件的字节,之后怎么输出就看系统需求了

posted @ 2015-10-09 18:00  yanzhenxing  阅读(9097)  评论(0编辑  收藏  举报