Activiti的流程定义文件解析(后续)
2013-09-26 00:00
537 查看
今天同事无意之间发现一种更简单的方法去实现对流程定义文件的解析:
即在 activiti-engine源码包下的test目录下:org.activiti.standalone.parsing.ChineseConverterTest该类下的方法:
BpmnXMLConverter进行转换即可获取BpmnModel。
有了这么简洁的方法,可以对之前的那种实现无视了...
同样也发现原来在test目录下会有这么好的东西,看来以后得好好看看了...
即在 activiti-engine源码包下的test目录下:org.activiti.standalone.parsing.ChineseConverterTest该类下的方法:
protected BpmnModel readXMLFile() throws Exception { InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream(getResource()); StreamSource xmlSource = new InputStreamSource(xmlStream); BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding()); return bpmnModel; }只需获取流程定义文件流,最后通过
BpmnXMLConverter进行转换即可获取BpmnModel。
有了这么简洁的方法,可以对之前的那种实现无视了...
同样也发现原来在test目录下会有这么好的东西,看来以后得好好看看了...
相关文章推荐
- Activiti的流程定义文件解析
- 扩展Activiti流程定义文件,实现自定义节点属性
- 扩展Activiti流程定义文件,实现自定义节点属性
- activiti 查询流程定义启动流程
- 【Activiti工作流】7.流程定义的CRUD(下)
- activiti 删除流程定义
- Activiti学习入门(2) -- 学习部署Activiti流程定义
- Android中measure过程、WRAP_CONTENT详解以及xml布局文件解析流程浅析(上)
- C++使用static的错误:无法解析的外部符号、“static”不应在文件范围内定义的成员函数上使用
- AMR 文件解析及编解码流程
- 【Activiti工作流】7.流程定义的CRUD(上)
- 头文件不宜定义变量原因解析
- Activiti支持直接部署扩展名为bpmn的流程文件
- 工作流学习笔记——Activiti流程定义管理三步曲
- 报表定义文件出现 xmlns="" 造成报表无法解析怎么办?
- 工作流学习——Activiti流程定义管理三步曲
- AMR 文件解析及编解码流程
- Activiti解析.bpmn文件获得User Task节点的CandidateUsers特性的值
- Activiti 查询最新版本的流程定义
- jbpm教程(二)创建公文 并把公文与流程定义文件相互绑定