use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class GetAllAuditTasksByStatusCommand method execute.
@Override
public List<AuditTask> execute(Context context) {
TaskPersistenceContext persistenceContext = ((TaskContext) context).getPersistenceContext();
List<AuditTask> groupTasks = persistenceContext.queryWithParametersInTransaction("getAllAuditTasksByStatus", persistenceContext.addParametersToMap("owner", userId, "statuses", filter.getParams().get("statuses"), "firstResult", filter.getOffset(), "maxResults", filter.getCount()), ClassUtil.<List<AuditTask>>castClass(List.class));
return groupTasks;
}
use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class GetAllGroupAuditTasksByUserCommand method execute.
@Override
public List<AuditTask> execute(Context context) {
TaskPersistenceContext persistenceContext = ((TaskContext) context).getPersistenceContext();
boolean userExists = doCallbackUserOperation(userId, (TaskContext) context);
List<String> groupIds = doUserGroupCallbackOperation(userId, null, (TaskContext) context);
groupIds.add(userId);
List<AuditTask> groupTasks = persistenceContext.queryWithParametersInTransaction("getAllGroupAuditTasksByUser", persistenceContext.addParametersToMap("potentialOwners", groupIds, "firstResult", filter.getOffset(), "maxResults", filter.getCount()), ClassUtil.<List<AuditTask>>castClass(List.class));
return groupTasks;
}
use of org.kie.internal.task.api.AuditTask in project jbpm by kiegroup.
the class RuntimeDataServiceEJBIntegrationTest 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());
}
Aggregations