use of org.activiti.engine.repository.Deployment in project Activiti by Activiti.
the class SimpleSimulationRunTest method step0Check.
private void step0Check(RepositoryService repositoryService) {
Deployment deployment;
deployment = repositoryService.createDeploymentQuery().singleResult();
assertNotNull(deployment);
}
use of org.activiti.engine.repository.Deployment in project Activiti by Activiti.
the class DeploymentCacheLimitTest method testDeploymentCacheLimit.
public void testDeploymentCacheLimit() {
// This is set in the configuration above
int processDefinitionCacheLimit = 3;
DefaultDeploymentCache<ProcessDefinitionEntity> processDefinitionCache = (DefaultDeploymentCache<ProcessDefinitionEntity>) processEngineConfiguration.getProcessDefinitionCache();
assertEquals(0, processDefinitionCache.size());
String processDefinitionTemplate = DeploymentCacheTestUtil.readTemplateFile("/org/activiti/standalone/deploy/deploymentCacheTest.bpmn20.xml");
for (int i = 1; i <= 5; i++) {
repositoryService.createDeployment().addString("Process " + i + ".bpmn20.xml", MessageFormat.format(processDefinitionTemplate, i)).deploy();
if (i < processDefinitionCacheLimit) {
assertEquals(i, processDefinitionCache.size());
} else {
assertEquals(processDefinitionCacheLimit, processDefinitionCache.size());
}
}
// Cleanup
for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
repositoryService.deleteDeployment(deployment.getId(), true);
}
}
use of org.activiti.engine.repository.Deployment in project Activiti by Activiti.
the class CustomDeploymentCacheTest method testCustomDeploymentCacheUsed.
public void testCustomDeploymentCacheUsed() {
CustomDeploymentCache customCache = (CustomDeploymentCache) processEngineConfiguration.getProcessDefinitionCache();
assertNull(customCache.getCachedProcessDefinition());
String processDefinitionTemplate = DeploymentCacheTestUtil.readTemplateFile("/org/activiti/standalone/deploy/deploymentCacheTest.bpmn20.xml");
for (int i = 1; i <= 5; i++) {
repositoryService.createDeployment().addString("Process " + i + ".bpmn20.xml", MessageFormat.format(processDefinitionTemplate, i)).deploy();
assertNotNull(customCache.getCachedProcessDefinition());
}
// Cleanup
for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
repositoryService.deleteDeployment(deployment.getId(), true);
}
}
use of org.activiti.engine.repository.Deployment in project Activiti by Activiti.
the class RestResponseFactory method createDeploymentResponseList.
public List<DeploymentResponse> createDeploymentResponseList(List<Deployment> deployments) {
RestUrlBuilder urlBuilder = createUrlBuilder();
List<DeploymentResponse> responseList = new ArrayList<DeploymentResponse>();
for (Deployment instance : deployments) {
responseList.add(createDeploymentResponse(instance, urlBuilder));
}
return responseList;
}
use of org.activiti.engine.repository.Deployment in project Activiti by Activiti.
the class MuleVMTest method send.
@Test
public void send() throws Exception {
Assert.assertTrue(muleContext.isStarted());
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
Deployment deployment = repositoryService.createDeployment().addClasspathResource("org/activiti/mule/testVM.bpmn20.xml").deploy();
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess");
Assert.assertFalse(processInstance.isEnded());
Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable");
Assert.assertEquals(30, result);
runtimeService.deleteProcessInstance(processInstance.getId(), "test");
processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId());
repositoryService.deleteDeployment(deployment.getId());
assertAndEnsureCleanDb(processEngine);
ProcessEngines.destroy();
}
Aggregations