package cn.dajiaccp.acti01; import java.io.InputStream; import org.activiti.engine.ProcessEngine; import org.activiti.engine.ProcessEngines; import org.activiti.engine.RepositoryService; import org.activiti.engine.repository.Deployment; import org.activiti.engine.repository.DeploymentBuilder; /** * 将流程模板(流程图)部署到仓库 只做一遍 * @author Administrator * */ public class Test01 { public static void main(String[] args) { //得到流程引擎 ProcessEngine pe = ProcessEngines.getDefaultProcessEngine(); //得到仓库服务 RepositoryService repositoryService = pe.getRepositoryService(); //定义流 加载bpmn文件 InputStream bpmn_in = Test01.class.getClassLoader().getResourceAsStream("cn/dajiaccp/diagram/qingjiaFlow.bpmn"); InputStream png_in = Test01.class.getClassLoader().getResourceAsStream("cn/dajiaccp/diagram/qingjiaFlow.png"); //通过仓库部署工作流 方法链的调用 Deployment deploy = repositoryService.createDeployment() .addInputStream("bpmn_in.bpmn", bpmn_in) .addInputStream("png_in.png", png_in) .name("请假申请").category("行政类") .deploy(); /* DeploymentBuilder builder = repositoryService.createDeployment(); builder = builder.addInputStream("bpmn_in", bpmn_in); builder = builder.addInputStream("png_in", png_in); builder = builder.name("请假申请"); builder = builder.category("行政类"); builder.deploy(); */ System.out.println(deploy); } public void hello(){ StringBuffer sb = new StringBuffer(); // sb.append("111").append("222").append("3333"); sb = sb.append("111"); sb = sb.append("222"); sb = sb.append("333"); System.out.println(sb); //11122233 } }