Search in sources :

Example 6 with TaskQuery

use of pro.taskana.TaskQuery in project taskana by Taskana.

the class QueryTasksAccTest method testQueryAndCountMatch.

@WithAccessId(userName = "user_1_1", groupNames = { "group_1" })
@Test
public void testQueryAndCountMatch() {
    TaskService taskService = taskanaEngine.getTaskService();
    TaskQuery taskQuery = taskService.createTaskQuery();
    List<TaskSummary> tasks = taskQuery.nameIn("Task99", "Task01", "Widerruf").list();
    long numberOfTasks = taskQuery.nameIn("Task99", "Task01", "Widerruf").count();
    Assert.assertEquals(numberOfTasks, tasks.size());
}
Also used : TaskService(pro.taskana.TaskService) TaskQuery(pro.taskana.TaskQuery) TaskSummary(pro.taskana.TaskSummary) TaskanaEngineProxyForTest(pro.taskana.impl.TaskanaEngineProxyForTest) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 7 with TaskQuery

use of pro.taskana.TaskQuery in project taskana by Taskana.

the class QueryObjectReferenceAccTest method testQueryObjectReferenceValuesForColumnName.

@Test
public void testQueryObjectReferenceValuesForColumnName() {
    TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
    List<String> columnValues = taskQuery.createObjectReferenceQuery().listValues("COMPANY", null);
    assertEquals(3, columnValues.size());
    columnValues = taskQuery.createObjectReferenceQuery().listValues("SYSTEM", null);
    assertEquals(3, columnValues.size());
    columnValues = taskQuery.createObjectReferenceQuery().systemIn("System1").listValues("SYSTEM", null);
    assertEquals(1, columnValues.size());
}
Also used : TaskQuery(pro.taskana.TaskQuery) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 8 with TaskQuery

use of pro.taskana.TaskQuery in project taskana by Taskana.

the class QueryObjectReferenceAccTest method testFindObjectReferenceBySystemInstance.

@Test
public void testFindObjectReferenceBySystemInstance() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
    TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
    List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery().companyIn("Company1", "Company2").systemInstanceIn("Instance1").list();
    assertNotNull(objectReferenceList);
    assertEquals(1, objectReferenceList.size());
}
Also used : ObjectReference(pro.taskana.impl.ObjectReference) TaskQuery(pro.taskana.TaskQuery) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 9 with TaskQuery

use of pro.taskana.TaskQuery in project taskana by Taskana.

the class QueryObjectReferenceAccTest method testFindObjectReferenceBySystem.

@Test
public void testFindObjectReferenceBySystem() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
    TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
    List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery().companyIn("Company1", "Company2").systemIn("System2").list();
    assertNotNull(objectReferenceList);
    assertEquals(1, objectReferenceList.size());
}
Also used : ObjectReference(pro.taskana.impl.ObjectReference) TaskQuery(pro.taskana.TaskQuery) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Aggregations

TaskQuery (pro.taskana.TaskQuery)9 AbstractAccTest (acceptance.AbstractAccTest)7 Test (org.junit.Test)7 ObjectReference (pro.taskana.impl.ObjectReference)5 TaskSummary (pro.taskana.TaskSummary)3 TaskService (pro.taskana.TaskService)2 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 PageMetadata (org.springframework.hateoas.PagedResources.PageMetadata)1 ResponseEntity (org.springframework.http.ResponseEntity)1 Component (org.springframework.stereotype.Component)1 Transactional (org.springframework.transaction.annotation.Transactional)1 MultiValueMap (org.springframework.util.MultiValueMap)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 TaskState (pro.taskana.TaskState)1 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)1 TaskanaEngineProxyForTest (pro.taskana.impl.TaskanaEngineProxyForTest)1