Package com.founder.fix.fixflow.core.model

Examples of com.founder.fix.fixflow.core.model.DeploymentBuilder


  /**
   * 测试获取用户有权限启动的流程。  startProcessByUser.bpmn设置为所有人启动,StartProcessInstanceTest.bpmn设置为1035555启动,结果中应含有前者,不含有后者。
   */
  public void testGetStartProcessByUserId() {

    DeploymentBuilder deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");
    //添加你要发布的定义
    deploymentBuilder.addClasspathResource("com/founder/fix/fixflow/test/engine/api/model/startProcessByUser.bpmn");
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    assertNotNull(deploymentIdTemp);
    //重置下流程发布,发布下一个流程
    DeploymentBuilder deploymentBuilder2 = processEngine.getModelService().createDeployment().name("测试发布");
    deploymentBuilder2.addClasspathResource("com/founder/fix/fixflow/test/engine/api/model/StartProcessInstanceTest.bpmn");
    //发布
    deploymentIdTemp = deploymentBuilder2.deploy().getId();
    assertNotNull(deploymentIdTemp);
   
    //取到用户可以启动的流程列表
    List<Map<String,String>> processList = modelService.getStartProcessByUserId("10691103");
    //判断含有startProcessByUser
View Full Code Here


  /**
   * 测试通过zip文件发布流程,流程定义发布全部采用从设计器导出的.zip文件   发布.zip文件中包含xxx.bpmn、xxx.png
   */
  public void testAddZipInputStream(){
    //创建一个发布
    DeploymentBuilder deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");
    //获取zip文件的inputStream流
    InputStream inputStream = ReflectUtil.getResourceAsStream("com/founder/fix/fixflow/test/engine/api/model/Process_TaskServiceTest.zip");
    //发布流程定义
    deploymentBuilder.addZipInputStream(new ZipInputStream(inputStream));
    String deploymentId = deploymentBuilder.deploy().getId();
    //验证是否发布成功
    assertNotNull(deploymentId);
    //创建流程定义查询
    ProcessDefinitionQuery processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询刚发布的流程定义
View Full Code Here

  /**
   * 测试获取流程图
   */
  public void testGetFlowGraphicsImgStream(){
    //创建一个发布
    DeploymentBuilder deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");
    //获取zip文件的inputStream流
    InputStream inputStream = ReflectUtil.getResourceAsStream("com/founder/fix/fixflow/test/engine/api/model/Process_TaskServiceTest.zip");
    //发布流程定义
    deploymentBuilder.addZipInputStream(new ZipInputStream(inputStream));
    String deploymentId = deploymentBuilder.deploy().getId();
    //验证是否发布成功
    assertNotNull(deploymentId);
    //创建流程定义查询
    ProcessDefinitionQuery processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询刚发布的流程定义
View Full Code Here

  /**
   * 测试通过zip文件发布流程,流程定义发布全部采用从设计器导出的.zip文件   发布.zip文件中包含xxx.bpmn、xxx.png
   */
  public void testUpdateDeploymentId(){
    //创建一个发布
    DeploymentBuilder deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");
    //获取zip文件的inputStream流
    InputStream inputStream = ReflectUtil.getResourceAsStream("com/founder/fix/fixflow/test/engine/api/model/Process_TaskServiceTest.zip");
    //发布流程定义
    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");
    //获取查询到的流程定义
View Full Code Here

import com.founder.fix.fixflow.test.Deployment;

public class CallActivityTest extends AbstractFixFlowTestCase {

  public void testCallActivity() {
    DeploymentBuilder deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");
    //添加你要发布的定义
    deploymentBuilder.addClasspathResource("com/founder/fix/fixflow/test/bpmn/callactivity/CallActivityTest.bpmn");
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    assertNotNull(deploymentIdTemp);
    //重置下流程发布,发布下一个流程
    DeploymentBuilder deploymentBuilder2 = processEngine.getModelService().createDeployment().name("测试发布");
    deploymentBuilder2.addClasspathResource("com/founder/fix/fixflow/test/bpmn/subprocess/SubProcessTest.bpmn");
    //发布
    deploymentIdTemp = deploymentBuilder2.deploy().getId();
    assertNotNull(deploymentIdTemp);
   
    // 启动测试流程
    // 创建一个启动并提交命令
    ExpandTaskCommand expandTaskCommand = new ExpandTaskCommand();
View Full Code Here

      if (resources.length == 0) {
        return null;
      }


      DeploymentBuilder deploymentBuilder = processEngine.getModelService().createDeployment().name("测试名称");

      for (String resource : resources) {
        deploymentBuilder.addClasspathResource(resource);
      }

      deploymentId = deploymentBuilder.deploy().getId();

      // connection.close();
      // processEngine.contextClose();
    }
    return deploymentId;
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.model.DeploymentBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.