use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class ExternalTaskQueryAuthorizationTest method testQueryWithReadInstanceOnProcessDefinition.
public void testQueryWithReadInstanceOnProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, "oneExternalTaskProcess", userId, READ_INSTANCE);
// when
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();
// then
verifyQueryResults(query, 1);
assertEquals(instance1Id, query.list().get(0).getProcessInstanceId());
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class ExternalTaskQueryAuthorizationTest method testQueryWithReadInstanceWithMultiple.
public void testQueryWithReadInstanceWithMultiple() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
createGrantAuthorization(PROCESS_DEFINITION, "oneExternalTaskProcess", userId, READ_INSTANCE);
createGrantAuthorization(PROCESS_INSTANCE, instance1Id, userId, READ);
// when
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();
// then
verifyQueryResults(query, 2);
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class ExternalTaskQueryAuthorizationTest method testQueryWithReadInstanceOnAnyProcessDefinition.
public void testQueryWithReadInstanceOnAnyProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
// when
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();
// then
verifyQueryResults(query, 2);
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessInstanceSuspensionStateTest method suspendProcessInstanceIncludingExternalTaskForTenant.
@Test
public void suspendProcessInstanceIncludingExternalTaskForTenant() {
// given activated external tasks
ExternalTaskQuery query = engineRule.getExternalTaskService().createExternalTaskQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionTenantId(TENANT_ONE).suspend();
assertThat(query.active().count(), is(2L));
assertThat(query.suspended().count(), is(1L));
assertThat(query.suspended().tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessInstanceSuspensionStateTest method activateProcessInstanceIncludingExternalTaskForNonTenant.
@Test
public void activateProcessInstanceIncludingExternalTaskForNonTenant() {
// given suspended external tasks
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
ExternalTaskQuery query = engineRule.getExternalTaskService().createExternalTaskQuery();
assertThat(query.active().count(), is(0L));
assertThat(query.suspended().count(), is(3L));
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().activate();
assertThat(query.suspended().count(), is(2L));
assertThat(query.active().count(), is(1L));
assertThat(query.active().singleResult().getTenantId(), is(nullValue()));
}
Aggregations