ProcessDefinition是负责流程定义的内,提供了几种方法来载入流程。
1。直接定义一个流程并载入
ProcessDefinition processDefinition = ProcessDefinition
.parseXMLString("<process-definition>" + " <start-state>"
+ " <transition to='s' />" + " </start-state>"
+ " <state name='s'>" + " <transition to='end' />"
+ " </state>" + " <end-state name='end' />"
+ "</process-definition>");
2。定义好的流程打包成一个zip.然后载入
File zipFile = new File("./Flows/MyTest_1.zip");
FileInputStream fIn = new FileInputStream(zipFile);
ZipInputStream zipIn = new ZipInputStream(fIn);
ProcessDefinition processDefinition = ProcessDefinition
.parseParZipInputStream(zipIn);
进入讨论组讨论。
(出处:http://www.knowsky.com)