use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class UpdateTaskAccTest method testUpdateTasksByPorForUser1.
@WithAccessId(userName = "user_1_1", groupNames = { "group_1" })
@Test
public void testUpdateTasksByPorForUser1() throws InvalidArgumentException {
ObjectReference por = new ObjectReference();
por.setCompany("00");
por.setSystem("PASystem");
por.setSystemInstance("00");
por.setType("VNR");
por.setValue("22334455");
Map<String, String> customProperties = new HashMap<>();
customProperties.put("7", "This is modifiedValue 7");
customProperties.put("14", null);
customProperties.put("3", "This is modifiedValue 3");
customProperties.put("16", "This is modifiedValue 16");
TaskService taskService = taskanaEngine.getTaskService();
List<String> taskIds = taskService.updateTasks(por, customProperties);
assertEquals(0, taskIds.size());
}
use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class UpdateTaskAccTest method testUpdateTasksByPor.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testUpdateTasksByPor() throws InvalidArgumentException, TaskNotFoundException, NotAuthorizedException {
ObjectReference por = new ObjectReference();
por.setCompany("00");
por.setSystem("PASystem");
por.setSystemInstance("00");
por.setType("VNR");
por.setValue("22334455");
Map<String, String> customProperties = new HashMap<>();
customProperties.put("7", "This is modifiedValue 7");
customProperties.put("14", null);
customProperties.put("3", "This is modifiedValue 3");
customProperties.put("16", "This is modifiedValue 16");
TaskService taskService = taskanaEngine.getTaskService();
List<String> taskIds = taskService.updateTasks(por, customProperties);
assertEquals(6, taskIds.size());
for (String taskId : taskIds) {
Task task = taskService.getTask(taskId);
assertEquals("This is modifiedValue 3", task.getCustomAttribute("3"));
assertEquals("This is modifiedValue 7", task.getCustomAttribute("7"));
assertEquals("This is modifiedValue 16", task.getCustomAttribute("16"));
assertNull(task.getCustomAttribute("14"));
}
}
use of pro.taskana.impl.ObjectReference 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());
}
use of pro.taskana.impl.ObjectReference 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());
}
Aggregations