@Test public void suspendProcessDefinitionForNonTenant() { // given activated process definitions ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .suspend(); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void suspendProcessDefinitionIncludingJobDefinitionsForNonTenant() { // given activated jobs JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .suspend(); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void suspendProcessDefinitionIncludeInstancesForNonTenant() { // given activated process instances ProcessInstanceQuery query = engineRule.getRuntimeService().createProcessInstanceQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .includeProcessInstances(true) .suspend(); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void delayedSuspendProcessDefinitionsForNonTenant() { // given activated process definitions engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .executionDate(tomorrow()) .suspend(); ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); // when execute the job to suspend the process definition Job job = engineRule.getManagementService().createJobQuery().timers().singleResult(); assertThat(job, is(notNullValue())); engineRule.getManagementService().executeJob(job.getId()); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void activateProcessDefinitionIncludingJobDefinitionsForNonTenant() { // given suspended jobs engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .suspend(); JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery(); assertThat(query.active().count(), is(0L)); assertThat(query.suspended().count(), is(3L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .activate(); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
@Test public void activateProcessDefinitionForNonTenant() { // given suspend process definitions engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .suspend(); ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.suspended().count(), is(3L)); assertThat(query.active().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .activate(); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
@Test public void activateProcessDefinitionIncludeInstancesForNonTenant() { // given suspended process instances engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .includeProcessInstances(true) .suspend(); ProcessInstanceQuery query = engineRule.getRuntimeService().createProcessInstanceQuery(); assertThat(query.suspended().count(), is(3L)); assertThat(query.active().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .includeProcessInstances(true) .activate(); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
@Test public void delayedActivateProcessDefinitionsForNonTenant() { // given suspended process definitions engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .suspend(); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .executionDate(tomorrow()) .activate(); ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.suspended().count(), is(3L)); assertThat(query.active().count(), is(0L)); // when execute the job to activate the process definition Job job = engineRule.getManagementService().createJobQuery().timers().singleResult(); assertThat(job, is(notNullValue())); engineRule.getManagementService().executeJob(job.getId()); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
.updateProcessDefinitionSuspensionState() .byProcessDefinitionKey("oneTaskProcessTimer_710") .processDefinitionWithoutTenantId() .includeProcessInstances(false) .executionDate(FIXED_DATE_THREE)
@Test public void suspendProcessDefinitionForNonTenant() { // given activated process definitions ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .suspend(); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void suspendProcessDefinitionIncludingJobDefinitionsForNonTenant() { // given activated jobs JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .suspend(); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void suspendProcessDefinitionIncludeInstancesForNonTenant() { // given activated process instances ProcessInstanceQuery query = engineRule.getRuntimeService().createProcessInstanceQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .includeProcessInstances(true) .suspend(); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void delayedSuspendProcessDefinitionsForNonTenant() { // given activated process definitions engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .executionDate(tomorrow()) .suspend(); ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.active().count(), is(3L)); assertThat(query.suspended().count(), is(0L)); // when execute the job to suspend the process definition Job job = engineRule.getManagementService().createJobQuery().timers().singleResult(); assertThat(job, is(notNullValue())); engineRule.getManagementService().executeJob(job.getId()); assertThat(query.active().count(), is(2L)); assertThat(query.suspended().count(), is(1L)); assertThat(query.suspended().withoutTenantId().count(), is(1L)); }
@Test public void activateProcessDefinitionForNonTenant() { // given suspend process definitions engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .suspend(); ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.suspended().count(), is(3L)); assertThat(query.active().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .activate(); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
@Test public void activateProcessDefinitionIncludingJobDefinitionsForNonTenant() { // given suspended jobs engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .suspend(); JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery(); assertThat(query.active().count(), is(0L)); assertThat(query.suspended().count(), is(3L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .activate(); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
@Test public void activateProcessDefinitionIncludeInstancesForNonTenant() { // given suspended process instances engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .includeProcessInstances(true) .suspend(); ProcessInstanceQuery query = engineRule.getRuntimeService().createProcessInstanceQuery(); assertThat(query.suspended().count(), is(3L)); assertThat(query.active().count(), is(0L)); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .includeProcessInstances(true) .activate(); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }
@Test public void delayedActivateProcessDefinitionsForNonTenant() { // given suspended process definitions engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .suspend(); engineRule.getRepositoryService() .updateProcessDefinitionSuspensionState() .byProcessDefinitionKey(PROCESS_DEFINITION_KEY) .processDefinitionWithoutTenantId() .executionDate(tomorrow()) .activate(); ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery(); assertThat(query.suspended().count(), is(3L)); assertThat(query.active().count(), is(0L)); // when execute the job to activate the process definition Job job = engineRule.getManagementService().createJobQuery().timers().singleResult(); assertThat(job, is(notNullValue())); engineRule.getManagementService().executeJob(job.getId()); assertThat(query.suspended().count(), is(2L)); assertThat(query.active().count(), is(1L)); assertThat(query.active().withoutTenantId().count(), is(1L)); }