use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancySignalReceiveTest method throwEndSignalForNonTenant.
@Test
public void throwEndSignalForNonTenant() {
testRule.deploy(SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS, SIGNAL_END_THROW_PROCESS);
testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);
engineRule.getRuntimeService().createProcessInstanceByKey("signalCatch").processDefinitionWithoutTenantId().execute();
engineRule.getRuntimeService().createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
engineRule.getRuntimeService().startProcessInstanceByKey("signalThrow");
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.withoutTenantId().count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancySignalReceiveTest method sendSignalToStartAndIntermediateCatchEventForMultipleTenants.
@Test
public void sendSignalToStartAndIntermediateCatchEventForMultipleTenants() {
testRule.deployForTenant(TENANT_ONE, SIGNAL_CATCH_PROCESS);
testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS);
engineRule.getRuntimeService().createProcessInstanceByKey("signalCatch").execute();
engineRule.getRuntimeService().createSignalEvent("signal").send();
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancySignalReceiveTest method sendSignalToStartAndIntermediateCatchEventForTenant.
@Test
public void sendSignalToStartAndIntermediateCatchEventForTenant() {
testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);
testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);
engineRule.getRuntimeService().createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
engineRule.getRuntimeService().createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_TWO).execute();
engineRule.getRuntimeService().createSignalEvent("signal").tenantId(TENANT_ONE).send();
engineRule.getRuntimeService().createSignalEvent("signal").tenantId(TENANT_TWO).send();
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(2L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessInstanceSuspensionStateTest method activateProcessInstanceIncludingUserTaskForTenant.
@Test
public void activateProcessInstanceIncludingUserTaskForTenant() {
// given suspended user tasks
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.active().count(), is(0L));
assertThat(query.suspended().count(), is(3L));
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionTenantId(TENANT_ONE).activate();
assertThat(query.suspended().count(), is(2L));
assertThat(query.active().count(), is(1L));
assertThat(query.active().tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessInstanceSuspensionStateTest method suspendProcessInstanceIncludingUserTaskForNonTenant.
@Test
public void suspendProcessInstanceIncludingUserTaskForNonTenant() {
// given activated user tasks
TaskQuery query = engineRule.getTaskService().createTaskQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().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));
}
Aggregations