use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class AuditTaskDeleteTest method testTaskAuditServiceClear.
@Test
public void testTaskAuditServiceClear() {
AuditTaskQueryBuilder queryBuilder = this.auditTaskQuery();
List<AuditTask> tasks = queryBuilder.taskId(taskTestData[4].getId()).build().getResultList();
assertEquals(1, tasks.size());
queryBuilder.clear();
List<AuditTask> data = this.auditTaskQuery().build().getResultList();
assertEquals(10, data.size());
this.clear();
data = this.auditTaskQuery().build().getResultList();
assertEquals(0, data.size());
}
use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class RuntimeDataServiceImplTest method testGetAuditTaskByStatus.
@Test
public void testGetAuditTaskByStatus() throws Exception {
processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
assertNotNull(processInstanceId);
ProcessInstance instance = processService.getProcessInstance(processInstanceId);
assertNotNull(instance);
Collection<NodeInstance> activeNodes = ((WorkflowProcessInstanceImpl) instance).getNodeInstances();
assertNotNull(activeNodes);
assertEquals(1, activeNodes.size());
NodeInstance node = activeNodes.iterator().next();
assertNotNull(node);
assertTrue(node instanceof WorkItemNodeInstance);
Long workItemId = ((WorkItemNodeInstance) node).getWorkItemId();
assertNotNull(workItemId);
List<String> statuses = new ArrayList();
statuses.add(Status.Reserved.toString());
Map<String, Object> params = new HashMap<String, Object>();
params.put("statuses", statuses);
QueryFilter queryFilter = new QueryFilter();
queryFilter.setParams(params);
List<AuditTask> auditTasks = runtimeDataService.getAllAuditTaskByStatus("salaboy", queryFilter);
assertNotNull(auditTasks);
assertEquals(1, auditTasks.size());
assertEquals("Write a Document", auditTasks.get(0).getName());
processService.abortProcessInstance(processInstanceId);
processInstanceId = null;
}
use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class RuntimeDataServiceImplTest method testGetTaskAudit.
@Test
public void testGetTaskAudit() {
processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
assertNotNull(processInstanceId);
ProcessInstance instance = processService.getProcessInstance(processInstanceId);
assertNotNull(instance);
Collection<NodeInstance> activeNodes = ((WorkflowProcessInstanceImpl) instance).getNodeInstances();
assertNotNull(activeNodes);
assertEquals(1, activeNodes.size());
NodeInstance node = activeNodes.iterator().next();
assertNotNull(node);
assertTrue(node instanceof WorkItemNodeInstance);
Long workItemId = ((WorkItemNodeInstance) node).getWorkItemId();
assertNotNull(workItemId);
List<AuditTask> auditTasks = runtimeDataService.getAllAuditTask("salaboy", new QueryFilter(0, 10));
assertNotNull(auditTasks);
assertEquals(1, auditTasks.size());
assertEquals("Write a Document", auditTasks.get(0).getName());
processService.abortProcessInstance(processInstanceId);
processInstanceId = null;
}
use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class RuntimeDataServiceImplTaskLookupTest method testGetAllAdminAuditTask.
@Test
public void testGetAllAdminAuditTask() {
asssertProcessInstance();
List<AuditTask> auditTasks = runtimeDataService.getAllAdminAuditTask("maciej", new QueryFilter());
assertNotNull(auditTasks);
assertEquals(0, auditTasks.size());
auditTasks = runtimeDataService.getAllAdminAuditTask("kris", new QueryFilter());
assertNotNull(auditTasks);
assertEquals(0, auditTasks.size());
auditTasks = runtimeDataService.getAllAdminAuditTask("tihomir", new QueryFilter());
assertNotNull(auditTasks);
assertEquals(0, auditTasks.size());
}
use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class RuntimeDataServiceImplTaskLookupTest method testGetAllGroupAuditTasks.
@Test
public void testGetAllGroupAuditTasks() {
asssertProcessInstance();
List<AuditTask> auditTasks = runtimeDataService.getAllGroupAuditTask("maciej", new QueryFilter());
assertNotNull(auditTasks);
assertEquals(1, auditTasks.size());
assertEquals("AdminsTask", auditTasks.get(0).getName());
auditTasks = runtimeDataService.getAllGroupAuditTask("kris", new QueryFilter());
assertNotNull(auditTasks);
assertEquals(2, auditTasks.size());
assertAuditTasksContain("AdminsTask", auditTasks);
assertAuditTasksContain("ManagersTask", auditTasks);
auditTasks = runtimeDataService.getAllGroupAuditTask("tihomir", new QueryFilter());
assertNotNull(auditTasks);
assertEquals(0, auditTasks.size());
}
Aggregations