本文整理汇总了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);
}
}
示例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"));
}
示例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);
}
示例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();
}