Search in sources :

Example 1 with ObjectReference

use of pro.taskana.impl.ObjectReference in project taskana by Taskana.

the class QueryObjectReferenceAccTest method testFindObjectReferenceByType.

@Test
public void testFindObjectReferenceByType() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
    TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
    List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery().typeIn("Type2", "Type3").list();
    assertNotNull(objectReferenceList);
    assertEquals(2, objectReferenceList.size());
}
Also used : ObjectReference(pro.taskana.impl.ObjectReference) TaskQuery(pro.taskana.TaskQuery) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 2 with ObjectReference

use of pro.taskana.impl.ObjectReference in project taskana by Taskana.

the class QueryObjectReferenceAccTest method testFindObjectReferenceByCompany.

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

Example 3 with ObjectReference

use of pro.taskana.impl.ObjectReference in project taskana by Taskana.

the class QueryObjectReferenceAccTest method testFindObjectReferenceByValue.

@Test
public void testFindObjectReferenceByValue() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
    TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
    List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery().valueIn("Value1", "Value3").list();
    assertNotNull(objectReferenceList);
    assertEquals(2, objectReferenceList.size());
}
Also used : ObjectReference(pro.taskana.impl.ObjectReference) TaskQuery(pro.taskana.TaskQuery) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 4 with ObjectReference

use of pro.taskana.impl.ObjectReference in project taskana by Taskana.

the class ExampleBootstrap method test.

@PostConstruct
public void test() throws TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException, TaskAlreadyExistException, InvalidArgumentException {
    System.out.println("---------------------------> Start App");
    Task task = taskService.newTask("1");
    task.setName("Spring example task");
    ObjectReference objRef = new ObjectReference();
    objRef.setCompany("aCompany");
    objRef.setSystem("aSystem");
    objRef.setSystemInstance("anInstance");
    objRef.setType("aType");
    objRef.setValue("aValue");
    task.setPrimaryObjRef(objRef);
    task = taskService.createTask(task);
    System.out.println("---------------------------> Task started: " + task.getId());
    taskService.claim(task.getId());
    System.out.println("---------------------------> Task claimed: " + taskService.getTask(task.getId()).getOwner());
    taskService.completeTask(task.getId(), true);
    System.out.println("---------------------------> Task completed");
}
Also used : ObjectReference(pro.taskana.impl.ObjectReference) PostConstruct(javax.annotation.PostConstruct)

Example 5 with ObjectReference

use of pro.taskana.impl.ObjectReference in project taskana by Taskana.

the class AbstractAccTest method createObjectReference.

protected ObjectReference createObjectReference(String company, String system, String systemInstance, String type, String value) {
    ObjectReference objectReference = new ObjectReference();
    objectReference.setCompany(company);
    objectReference.setSystem(system);
    objectReference.setSystemInstance(systemInstance);
    objectReference.setType(type);
    objectReference.setValue(value);
    return objectReference;
}
Also used : ObjectReference(pro.taskana.impl.ObjectReference)

Aggregations

ObjectReference (pro.taskana.impl.ObjectReference)14 Test (org.junit.Test)8 AbstractAccTest (acceptance.AbstractAccTest)7 TaskQuery (pro.taskana.TaskQuery)5 HashMap (java.util.HashMap)2 PostConstruct (javax.annotation.PostConstruct)2 Task (pro.taskana.Task)2 TaskService (pro.taskana.TaskService)2 WithAccessId (pro.taskana.security.WithAccessId)2 GET (javax.ws.rs.GET)1 Classification (pro.taskana.Classification)1 Workbasket (pro.taskana.Workbasket)1 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)1