flowable 從zip壓縮包 部署流程定義

FH-Admin發表於2021-11-17
    /**部署流程定義(從zip壓縮包)
     * @param name        //部署名稱
     * @param zippath    //zip檔案路徑
     * @return 部署ID
     * @from  fhadmin.cn
     */
    protected String deploymentProcessDefinitionFromZip(String name, String zippath) throws Exception{
        File outfile = new File(zippath);
        FileInputStream inputStream = new FileInputStream(outfile);
        ZipInputStream ipInputStream = new ZipInputStream(inputStream);
        DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();        //建立部署物件
        deploymentBuilder.name(name);                        //部署名稱
        deploymentBuilder.addZipInputStream(ipInputStream);
        Deployment deployment = deploymentBuilder.deploy();    //完成部署
        ipInputStream.close();
        inputStream.close();
        return deployment.getId();                            //部署ID
    }
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章