Search in sources :

Example 16 with HistoricCaseActivityInstance

use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.

the class HistoricCaseActivityInstanceResourceImpl method getHistoricCaseActivityInstance.

public HistoricCaseActivityInstanceDto getHistoricCaseActivityInstance() {
    HistoryService historyService = engine.getHistoryService();
    HistoricCaseActivityInstance instance = historyService.createHistoricCaseActivityInstanceQuery().caseActivityInstanceId(caseActivityInstanceId).singleResult();
    if (instance == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic case activity instance with id '" + caseActivityInstanceId + "' does not exist");
    }
    return HistoricCaseActivityInstanceDto.fromHistoricCaseActivityInstance(instance);
}
Also used : HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance)

Example 17 with HistoricCaseActivityInstance

use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceCmdsTenantCheckTest method disableCaseExecutionDisabledTenantCheck.

@Test
public void disableCaseExecutionDisabledTenantCheck() {
    identityService.setAuthentication("user", null, null);
    processEngineConfiguration.setTenantCheckEnabled(false);
    caseService.disableCaseExecution(caseExecutionId);
    identityService.clearAuthentication();
    HistoricCaseActivityInstance historicCaseActivityInstance = getHistoricCaseActivityInstance();
    assertThat(historicCaseActivityInstance, notNullValue());
    assertThat(historicCaseActivityInstance.isDisabled(), is(true));
}
Also used : HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance) Test(org.junit.Test)

Example 18 with HistoricCaseActivityInstance

use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceCmdsTenantCheckTest method completeCaseExecutionWithAuthenticatedTenant.

@Test
public void completeCaseExecutionWithAuthenticatedTenant() {
    caseService.manuallyStartCaseExecution(caseExecutionId);
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    caseService.completeCaseExecution(caseExecutionId);
    identityService.clearAuthentication();
    HistoricCaseActivityInstance historicCaseActivityInstance = getHistoricCaseActivityInstance();
    assertThat(historicCaseActivityInstance, notNullValue());
    assertThat(historicCaseActivityInstance.isCompleted(), is(true));
}
Also used : HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance) Test(org.junit.Test)

Example 19 with HistoricCaseActivityInstance

use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceCmdsTenantCheckTest method disableCaseExecutionWithAuthenticatedTenant.

@Test
public void disableCaseExecutionWithAuthenticatedTenant() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    caseService.disableCaseExecution(caseExecutionId);
    identityService.clearAuthentication();
    HistoricCaseActivityInstance historicCaseActivityInstance = getHistoricCaseActivityInstance();
    assertThat(historicCaseActivityInstance, notNullValue());
    assertThat(historicCaseActivityInstance.isDisabled(), is(true));
}
Also used : HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance) Test(org.junit.Test)

Example 20 with HistoricCaseActivityInstance

use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceCmdsTenantCheckTest method completeCaseExecutionDisabledTenantCheck.

@Test
public void completeCaseExecutionDisabledTenantCheck() {
    caseService.manuallyStartCaseExecution(caseExecutionId);
    identityService.setAuthentication("user", null, null);
    processEngineConfiguration.setTenantCheckEnabled(false);
    caseService.completeCaseExecution(caseExecutionId);
    identityService.clearAuthentication();
    HistoricCaseActivityInstance historicCaseActivityInstance = getHistoricCaseActivityInstance();
    assertThat(historicCaseActivityInstance, notNullValue());
    assertThat(historicCaseActivityInstance.isCompleted(), is(true));
}
Also used : HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance) Test(org.junit.Test)

Aggregations

HistoricCaseActivityInstance (org.camunda.bpm.engine.history.HistoricCaseActivityInstance)29 Deployment (org.camunda.bpm.engine.test.Deployment)17 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)11 HistoricCaseActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery)5 Test (org.junit.Test)5 HistoricCaseInstance (org.camunda.bpm.engine.history.HistoricCaseInstance)3 Task (org.camunda.bpm.engine.task.Task)3 Date (java.util.Date)2 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)2 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)2 Response (com.jayway.restassured.response.Response)1 ArrayList (java.util.ArrayList)1 HistoryService (org.camunda.bpm.engine.HistoryService)1 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)1 HistoricCaseActivityInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricCaseActivityInstanceDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 InOrder (org.mockito.InOrder)1