deploymentBuilder.addZipInputStream(new ZipInputStream(inputStream));
String deploymentId = deploymentBuilder.deploy().getId();
//验证是否发布成功
assertNotNull(deploymentId);
//创建流程定义查询
ProcessDefinitionQuery processDefinitionQuery = modelService.createProcessDefinitionQuery();
//查询刚发布的流程定义
processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
//验证是否查询到
assertNotNull(processDefinitionBehavior);
String deployId = processDefinitionBehavior.getDeploymentId();
deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");
//获取zip文件的inputStream流
inputStream = ReflectUtil.getResourceAsStream("com/founder/fix/fixflow/test/engine/api/model/Process_TaskServiceTest_new.zip");
//发布流程定义
deploymentBuilder.addZipInputStream(new ZipInputStream(inputStream));
//设置需要更新的发布号
deploymentBuilder.updateDeploymentId(deployId);
//更新流程定义
deploymentId = deploymentBuilder.deploy().getId();
//重置流程定义查询
processDefinitionQuery = modelService.createProcessDefinitionQuery();
//查询刚发布的流程定义
processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
//获取查询到的流程定义
processDefinitionBehavior=processDefinitionQuery.singleResult();
//验证是否查询到
assertNotNull(processDefinitionBehavior);
//查询新的流程定义中有没有ScriptTask_1
FlowElement flowElement = processDefinitionBehavior.getFlowElement("ScriptTask_1");