use of org.kie.internal.runtime.manager.audit.query.ProcessInstanceLogDeleteBuilder in project jbpm by kiegroup.
the class AuditDeleteTest method testDeleteProcessInstanceInfoLogByDateRangeStart.
@Test
public void testDeleteProcessInstanceInfoLogByDateRangeStart() {
Date endDate = pilTestData[8].getEnd();
ProcessInstanceLogDeleteBuilder updateBuilder = this.processInstanceLogDelete().endDateRangeStart(endDate);
int result = updateBuilder.build().execute();
assertEquals(3, result);
}
use of org.kie.internal.runtime.manager.audit.query.ProcessInstanceLogDeleteBuilder in project jbpm by kiegroup.
the class AuditDeleteTest method testDeleteProcessInstanceInfoLogByProcessIdAndDate.
@Test
public void testDeleteProcessInstanceInfoLogByProcessIdAndDate() {
int p = 0;
String processId = pilTestData[p].getProcessId();
Date endDate = pilTestData[p].getEnd();
ProcessInstanceLogDeleteBuilder updateBuilder = this.processInstanceLogDelete().endDate(endDate).processId(processId);
int result = updateBuilder.build().execute();
assertEquals(1, result);
}
use of org.kie.internal.runtime.manager.audit.query.ProcessInstanceLogDeleteBuilder in project jbpm by kiegroup.
the class AuditDeleteTest method testDeleteProcessInstanceInfoLogByDate.
@Test
public void testDeleteProcessInstanceInfoLogByDate() {
int p = 0;
Date endDate = pilTestData[p++].getEnd();
ProcessInstanceLogDeleteBuilder updateBuilder = this.processInstanceLogDelete().endDate(endDate);
int result = updateBuilder.build().execute();
assertEquals(1, result);
}
use of org.kie.internal.runtime.manager.audit.query.ProcessInstanceLogDeleteBuilder in project jbpm by kiegroup.
the class AuditDeleteTest method testDeleteProcessInstanceInfoLogByDateRangeEnd.
@Test
public void testDeleteProcessInstanceInfoLogByDateRangeEnd() {
Date endDate = pilTestData[4].getEnd();
ProcessInstanceLogDeleteBuilder updateBuilder = this.processInstanceLogDelete().endDateRangeEnd(endDate);
int result = updateBuilder.build().execute();
assertEquals(5, result);
}
use of org.kie.internal.runtime.manager.audit.query.ProcessInstanceLogDeleteBuilder in project jbpm by kiegroup.
the class ProcessInstanceLogCleanTest method deleteLogsWithStatusActive.
@Test
public void deleteLogsWithStatusActive() {
KieSession kieSession = null;
List<ProcessInstance> instanceList1 = null;
List<ProcessInstance> instanceList2 = null;
try {
kieSession = createKSession(HELLO_WORLD_PROCESS, HUMAN_TASK);
instanceList1 = startProcess(kieSession, HELLO_WORLD_PROCESS_ID, 3);
instanceList2 = startProcess(kieSession, HUMAN_TASK_ID, 5);
ProcessInstanceLogDeleteBuilder deleteBuilder = auditService.processInstanceLogDelete().status(ProcessInstance.STATE_ACTIVE);
int deleteResult = deleteBuilder.build().execute();
Assertions.assertThat(deleteResult).isEqualTo(5);
ProcessInstanceLogQueryBuilder queryBuilder = auditService.processInstanceLogQuery().status(ProcessInstance.STATE_COMPLETED);
List<ProcessInstanceLog> queryList = queryBuilder.build().getResultList();
Assertions.assertThat(queryList).hasSize(3);
Assertions.assertThat(queryList).extracting("processId").containsExactly(HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID);
Assertions.assertThat(queryList).extracting("processVersion").containsExactly("1.0", "1.0", "1.0");
Assertions.assertThat(queryList).extracting("status").containsExactly(ProcessInstance.STATE_COMPLETED, ProcessInstance.STATE_COMPLETED, ProcessInstance.STATE_COMPLETED);
} finally {
if (instanceList2 != null) {
abortProcess(kieSession, instanceList2);
}
if (kieSession != null) {
kieSession.dispose();
}
}
}
Aggregations