@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml", "org/camunda/bpm/engine/test/repository/one.cmmn"}) public void testDeleteDeploymentClearsCache() { // fetch definition ids String processDefinitionId = repositoryService.createProcessDefinitionQuery().singleResult().getId(); String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId(); // fetch CMMN model to be placed to in the cache repositoryService.getCmmnModelInstance(caseDefinitionId); DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache(); // ensure definitions and models are part of the cache assertNotNull(deploymentCache.getProcessDefinitionCache().get(processDefinitionId)); assertNotNull(deploymentCache.getBpmnModelInstanceCache().get(processDefinitionId)); assertNotNull(deploymentCache.getCaseDefinitionCache().get(caseDefinitionId)); assertNotNull(deploymentCache.getCmmnModelInstanceCache().get(caseDefinitionId)); // when the deployment is deleted repositoryService.deleteDeployment(deploymentId, true); // then the definitions and models are removed from the cache assertNull(deploymentCache.getProcessDefinitionCache().get(processDefinitionId)); assertNull(deploymentCache.getBpmnModelInstanceCache().get(processDefinitionId)); assertNull(deploymentCache.getCaseDefinitionCache().get(caseDefinitionId)); assertNull(deploymentCache.getCmmnModelInstanceCache().get(caseDefinitionId)); }
Cache<String, CmmnModelInstance> cmmnModelInstanceCache = getCmmnModelInstanceCache(); if (!cmmnModelInstanceCache.isEmpty()) { result.addPurgeInformation(CachePurgeReport.CASE_MODEL_INST_CACHE, cmmnModelInstanceCache.keySet());
Cache<String, CmmnModelInstance> cmmnModelInstanceCache = getCmmnModelInstanceCache(); if (!cmmnModelInstanceCache.isEmpty()) { result.addPurgeInformation(CachePurgeReport.CASE_MODEL_INST_CACHE, cmmnModelInstanceCache.keySet());
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml", "org/camunda/bpm/engine/test/repository/one.cmmn"}) public void testDeleteDeploymentClearsCache() { // fetch definition ids String processDefinitionId = repositoryService.createProcessDefinitionQuery().singleResult().getId(); String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId(); // fetch CMMN model to be placed to in the cache repositoryService.getCmmnModelInstance(caseDefinitionId); DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache(); // ensure definitions and models are part of the cache assertNotNull(deploymentCache.getProcessDefinitionCache().get(processDefinitionId)); assertNotNull(deploymentCache.getBpmnModelInstanceCache().get(processDefinitionId)); assertNotNull(deploymentCache.getCaseDefinitionCache().get(caseDefinitionId)); assertNotNull(deploymentCache.getCmmnModelInstanceCache().get(caseDefinitionId)); // when the deployment is deleted repositoryService.deleteDeployment(deploymentId, true); // then the definitions and models are removed from the cache assertNull(deploymentCache.getProcessDefinitionCache().get(processDefinitionId)); assertNull(deploymentCache.getBpmnModelInstanceCache().get(processDefinitionId)); assertNull(deploymentCache.getCaseDefinitionCache().get(caseDefinitionId)); assertNull(deploymentCache.getCmmnModelInstanceCache().get(caseDefinitionId)); }
Cache<String, CmmnModelInstance> cmmnModelInstanceCache = getCmmnModelInstanceCache(); if (!cmmnModelInstanceCache.isEmpty()) { result.addPurgeInformation(CachePurgeReport.CASE_MODEL_INST_CACHE, cmmnModelInstanceCache.keySet());