码迷,mamicode.com
首页 > 其他好文 > 详细

部署工作流

时间:2018-01-15 20:20:33      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:creat   str   tor   cti   color   ice   inpu   定义   source   

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
    }
    
    
}

 

部署工作流

标签:creat   str   tor   cti   color   ice   inpu   定义   source   

原文地址:https://www.cnblogs.com/yoyo198212/p/8289299.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!