public virtual void TestProcessDefinitionDescription() { string id = repositoryService.CreateProcessDefinitionQuery().First().Id; IReadOnlyProcessDefinition processDefinition = ((RepositoryServiceImpl)repositoryService).GetDeployedProcessDefinition(id); Assert.AreEqual("This is really good process documentation!", processDefinition.Description); }
public virtual void TestGetBpmnXmlFileThroughService() { string deploymentId = repositoryService.CreateDeploymentQuery().First().Id; IList <string> deploymentResources = repositoryService.GetDeploymentResourceNames(deploymentId); // verify bpmn file name Assert.AreEqual(1, deploymentResources.Count); string bpmnResourceName = "resources/Bpmn/Deployment/BpmnDeploymentTest.TestGetBpmnXmlFileThroughService.bpmn20.xml"; Assert.AreEqual(bpmnResourceName, deploymentResources[0]); IProcessDefinition processDefinition = repositoryService.CreateProcessDefinitionQuery().First(); Assert.AreEqual(bpmnResourceName, processDefinition.ResourceName); Assert.IsNull(processDefinition.DiagramResourceName); Assert.IsFalse(processDefinition.GetHasStartFormKey()); IReadOnlyProcessDefinition readOnlyProcessDefinition = ((RepositoryServiceImpl)repositoryService).GetDeployedProcessDefinition(processDefinition.Id); Assert.IsNull(readOnlyProcessDefinition.DiagramResourceName); // verify content System.IO.Stream deploymentInputStream = repositoryService.GetResourceAsStream(deploymentId, bpmnResourceName); string contentFromDeployment = ReadInputStreamToString(deploymentInputStream); Assert.True(contentFromDeployment.Length > 0); Assert.True(contentFromDeployment.Contains("process id=\"emptyProcess\"")); System.IO.Stream fileInputStream = ReflectUtil.GetResourceAsStream("resources/Bpmn/Deployment/BpmnDeploymentTest.TestGetBpmnXmlFileThroughService.bpmn20.xml"); string contentFromFile = ReadInputStreamToString(fileInputStream); Assert.AreEqual(contentFromFile, contentFromDeployment); }
public virtual void testGetDeployedProcessDefinition() { // given string processDefinitionId = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY).Id; createGrantAuthorization(Resources.ProcessDefinition, ONE_TASK_PROCESS_KEY, userId, Permissions.Read); // when IReadOnlyProcessDefinition definition = ((RepositoryServiceImpl)repositoryService).GetDeployedProcessDefinition(processDefinitionId); // then Assert.NotNull(definition); }