部署流程定义
? JbpmConfiguration config = JbpmConfiguration.getInstance();
??JbpmContext context = config.createJbpmContext();
??
??//删除所有流程定义版本
??GraphSession session = context.getGraphSession();
??List defList = session.findAllProcessDefinitionVersions("LEAVE");
??if(defList != null && defList.size() > 0){
????? for(int i=0;i<defList.size();i++){
????????? ProcessDefinition def = (ProcessDefinition)defList.get(i);
????????? session.deleteProcessDefinition(def.getId());
????? }
??}
??
??//部署流程定义
??InputStream in = new FileInputStream("bin/leave/processdefinition.xml");
??ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(in);
??
? context.deployProcessDefinition(processDefinition);
??context.close();