当前位置: 首页>>代码示例>>Java>>正文


Java Deployment.getId方法代码示例

本文整理汇总了Java中org.activiti.engine.repository.Deployment.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Deployment.getId方法的具体用法?Java Deployment.getId怎么用?Java Deployment.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.repository.Deployment的用法示例。


在下文中一共展示了Deployment.getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deploymentQueryTest

import org.activiti.engine.repository.Deployment; //导入方法依赖的package包/类
@Test
public void deploymentQueryTest() {
    List<Deployment> deploymentList = repositoryService.createDeploymentQuery()
            .list();

    for (Deployment deployment : deploymentList) {
        String tmp = "\r\n" +
                "#=======================================================================================================================#\r\n" +
                "# Spring MVC Context 容器初始化完成之后的处理:\r\n" +
                "#\t getId " + deployment.getId() + "\r\n" +
                "#\t getName " + deployment.getName() + "\r\n" +
                "#\t getDeploymentTime " + deployment.getDeploymentTime() + "\r\n" +
                "#\t getCategory " + deployment.getCategory() + "\r\n" +
                "#\t getTenantId " + deployment.getTenantId() + "\r\n" +
                "#=======================================================================================================================#\r\n";
        logger.info(tmp);
    }
}
 
开发者ID:Lzw2016,项目名称:study,代码行数:19,代码来源:Test02.java

示例2: testZipStreamFromAbsoluteFilePath

import org.activiti.engine.repository.Deployment; //导入方法依赖的package包/类
@Test
public void testZipStreamFromAbsoluteFilePath() throws Exception {
    // 从classpath读取资源并部署到引擎中
    InputStream zipStream = getClass().getClassLoader().getResourceAsStream("chapter5/chapter5-deployment.bar");
    repositoryService.createDeployment().addZipInputStream(new ZipInputStream(zipStream)).deploy();

    // 统计已部署流程定义的数量
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(2, count);

    // 查询部署记录
    Deployment deployment = repositoryService.createDeploymentQuery().singleResult();
    assertNotNull(deployment);
    String deploymentId = deployment.getId();

    // 验证4个资源文件是否都已成功部署
    assertNotNull(repositoryService.getResourceAsStream(deploymentId, "candidateUserInUserTask.bpmn"));
    assertNotNull(repositoryService.getResourceAsStream(deploymentId, "candidateUserInUserTask.png"));
    assertNotNull(repositoryService.getResourceAsStream(deploymentId, "userAndGroupInUserTask.bpmn"));
    assertNotNull(repositoryService.getResourceAsStream(deploymentId, "userAndGroupInUserTask.png"));
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:22,代码来源:ZipStreamDeploymentTest.java

示例3: testDeploymentPersistence

import org.activiti.engine.repository.Deployment; //导入方法依赖的package包/类
public void testDeploymentPersistence() {
  Deployment deployment = repositoryService
    .createDeployment()
    .name("strings")
    .addString("org/activiti/test/HelloWorld.string", "hello world")
    .addString("org/activiti/test/TheAnswer.string", "42")
    .deploy();
  
  List<Deployment> deployments = repositoryService.createDeploymentQuery().list();
  assertEquals(1, deployments.size());
  deployment = deployments.get(0);
  
  assertEquals("strings", deployment.getName());
  assertNotNull(deployment.getDeploymentTime());
  
  String deploymentId = deployment.getId();
  List<String> resourceNames = repositoryService.getDeploymentResourceNames(deploymentId);
  Set<String> expectedResourceNames = new HashSet<String>();
  expectedResourceNames.add("org/activiti/test/HelloWorld.string");
  expectedResourceNames.add("org/activiti/test/TheAnswer.string");
  assertEquals(expectedResourceNames, new HashSet<String>(resourceNames));
  
  InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, "org/activiti/test/HelloWorld.string");
  assertTrue(Arrays.equals("hello world".getBytes(), IoUtil.readInputStream(resourceStream, "test")));
  
  resourceStream = repositoryService.getResourceAsStream(deploymentId, "org/activiti/test/TheAnswer.string");
  assertTrue(Arrays.equals("42".getBytes(), IoUtil.readInputStream(resourceStream, "test")));

  repositoryService.deleteDeployment(deploymentId);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:31,代码来源:DeploymentPersistenceTest.java

示例4: deployWorkflow

import org.activiti.engine.repository.Deployment; //导入方法依赖的package包/类
private String deployWorkflow() throws Exception
{
    Deployment deployment = repositoryService.createDeployment().addClasspathResource(ACTIVITI_XML_HERD_WORKFLOW).deploy();
    assertNotNull(deployment.getId());
    return deployment.getId();
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:7,代码来源:ActivitiTest.java


注:本文中的org.activiti.engine.repository.Deployment.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。