Search in sources :

Example 6 with HistoricDecisionInstanceQuery

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

the class BatchHistoricDecisionInstanceDeletionUserOperationTest method testNoCreationOnJobExecutorBatchJobExecutionByIdsAndQuery.

@Test
public void testNoCreationOnJobExecutorBatchJobExecutionByIdsAndQuery() {
    // given
    // given
    HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION);
    historyService.deleteHistoricDecisionInstancesAsync(decisionInstanceIds, query, null);
    // when
    testRule.waitForJobExecutorToProcessAllJobs(5000L);
    // then
    assertEquals(0, engineRule.getHistoryService().createUserOperationLogQuery().count());
}
Also used : HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery) Test(org.junit.Test)

Example 7 with HistoricDecisionInstanceQuery

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

the class BatchHistoricDecisionInstanceDeletionUserOperationTest method testNoCreationOnJobExecutorBatchJobExecutionByQuery.

@Test
public void testNoCreationOnJobExecutorBatchJobExecutionByQuery() {
    // given
    // given
    HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION);
    historyService.deleteHistoricDecisionInstancesAsync(query, null);
    // when
    testRule.waitForJobExecutorToProcessAllJobs(5000L);
    // then
    assertEquals(0, engineRule.getHistoryService().createUserOperationLogQuery().count());
}
Also used : HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery) Test(org.junit.Test)

Example 8 with HistoricDecisionInstanceQuery

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

the class BatchHistoricDecisionInstanceDeletionUserOperationTest method testNoCreationOnSyncBatchJobExecutionByIdsAndQuery.

@Test
public void testNoCreationOnSyncBatchJobExecutionByIdsAndQuery() {
    // given
    HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION);
    Batch batch = historyService.deleteHistoricDecisionInstancesAsync(decisionInstanceIds, query, null);
    // when
    engineRule.getIdentityService().setAuthenticatedUserId(USER_ID);
    executeJobs(batch);
    engineRule.getIdentityService().clearAuthentication();
    // then
    assertEquals(0, engineRule.getHistoryService().createUserOperationLogQuery().count());
}
Also used : HistoricBatch(org.camunda.bpm.engine.batch.history.HistoricBatch) Batch(org.camunda.bpm.engine.batch.Batch) HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery) Test(org.junit.Test)

Example 9 with HistoricDecisionInstanceQuery

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

the class BatchHistoricDecisionInstanceDeletionTest method createMonitorJobByQuery.

@Test
public void createMonitorJobByQuery() {
    // given
    HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION);
    Batch batch = historyService.deleteHistoricDecisionInstancesAsync(query, null);
    // when
    helper.executeSeedJob(batch);
    // then the seed job definition still exists but the seed job is removed
    JobDefinition seedJobDefinition = helper.getSeedJobDefinition(batch);
    assertNotNull(seedJobDefinition);
    Job seedJob = helper.getSeedJob(batch);
    assertNull(seedJob);
    // and a monitor job definition and job exists
    JobDefinition monitorJobDefinition = helper.getMonitorJobDefinition(batch);
    assertNotNull(monitorJobDefinition);
    Job monitorJob = helper.getMonitorJob(batch);
    assertNotNull(monitorJob);
}
Also used : Batch(org.camunda.bpm.engine.batch.Batch) HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery) Job(org.camunda.bpm.engine.runtime.Job) JobDefinition(org.camunda.bpm.engine.management.JobDefinition) Test(org.junit.Test)

Example 10 with HistoricDecisionInstanceQuery

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

the class BatchHistoricDecisionInstanceDeletionTest method createBatchDeletionByQuery.

@Test
public void createBatchDeletionByQuery() {
    // given
    HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION);
    // when
    Batch batch = historyService.deleteHistoricDecisionInstancesAsync(query, null);
    // then
    assertBatchCreated(batch, 10);
}
Also used : Batch(org.camunda.bpm.engine.batch.Batch) HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery) Test(org.junit.Test)

Aggregations

HistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)82 Deployment (org.camunda.bpm.engine.test.Deployment)37 NativeHistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery)36 Test (org.junit.Test)22 Batch (org.camunda.bpm.engine.batch.Batch)17 Job (org.camunda.bpm.engine.runtime.Job)9 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)7 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)7 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)6 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)4 Response (com.jayway.restassured.response.Response)3 HashMap (java.util.HashMap)3 HistoricBatch (org.camunda.bpm.engine.batch.history.HistoricBatch)3 Matchers.anyString (org.mockito.Matchers.anyString)3 Date (java.util.Date)2 List (java.util.List)2 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)2 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)2 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)2 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)2