flowable 部署流程定义(从Classpath) 和 (根据ui.modeler的 modelId部署)

    /**部署流程定义(根据ui.modeler的 modelId部署)
     * @param modelId 模型ID
     * @from  fhadmin.cn
     */
    protected String deploymentProcessDefinitionFromUIModelId(String modelId) throws Exception{
        Model model = modelService.getModel(modelId);
        BpmnModel bpmnModel = modelService.getBpmnModel(model);
        Deployment deployment = repositoryService.createDeployment()
        .name(model.getName())
        .addBpmnModel(model.getKey() + ".bpmn", bpmnModel).deploy();
        return deployment.getId();    //部署ID
    }

    /**部署流程定义(从Classpath)
     * @param name        //部署名称
     * @param xmlpath    //xml文件路径
     * @param pngpath    //png文件路径
     * @from  fhadmin.cn
     */
    protected String deploymentProcessDefinitionFromClasspath(String name, String xmlpath, String pngpath){
        DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();        //创建部署对象
        deploymentBuilder.name(name);                        //部署名称
        deploymentBuilder.addClasspathResource(xmlpath);    //从文件中读取xml资源
        deploymentBuilder.addClasspathResource(pngpath);    //从文件中读取png资源
        Deployment deployment = deploymentBuilder.deploy();    //完成部署
        return deployment.getId();                            //部署ID
    }
本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!