use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class TaskServiceImplIntAutocommitTest method testWithPrimaryObjectRef.
@Test
public void testWithPrimaryObjectRef() throws FileNotFoundException, SQLException, TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, ClassificationNotFoundException, ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {
Workbasket wb = workbasketService.newWorkbasket("workbasket", "DOMAIN_A");
wb.setName("workbasket");
wb.setType(WorkbasketType.GROUP);
taskanaEngine.getWorkbasketService().createWorkbasket(wb);
Classification classification = classificationService.newClassification("TEST", "DOMAIN_A", "TASK");
taskanaEngine.getClassificationService().createClassification(classification);
Task task = taskServiceImpl.newTask(wb.getId());
task.setName("Unit Test Task");
task.setClassificationKey(classification.getKey());
ObjectReference objRef = new ObjectReference();
objRef.setCompany("novatec");
objRef.setSystem("linux");
objRef.setSystemInstance("inst1");
objRef.setType("fast");
objRef.setValue("4711");
task.setPrimaryObjRef(objRef);
task = taskServiceImpl.createTask(task);
Task task2 = taskServiceImpl.getTask(task.getId());
// skanaEngineImpl.getSqlSession().commit(); // needed so that the change is visible in the other session
Assert.assertNotNull(task2);
}
use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class TaskanaComponent method triggerRollback.
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, InvalidWorkbasketException, TaskAlreadyExistException, InvalidArgumentException {
Task task = taskService.newTask("1");
task.setName("Unit Test 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);
throw new RuntimeException();
}
use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class ExampleBootstrap method init.
@PostConstruct
public void init(@Observes @Initialized(ApplicationScoped.class) Object init) throws TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException, TaskAlreadyExistException, InvalidArgumentException {
System.out.println("---------------------------> Start App");
Task task = taskanaEjb.getTaskService().newTask(null);
ObjectReference objRef = new ObjectReference();
objRef.setCompany("aCompany");
objRef.setSystem("aSystem");
objRef.setSystemInstance("anInstance");
objRef.setType("aType");
objRef.setValue("aValue");
task.setPrimaryObjRef(objRef);
task = taskanaEjb.getTaskService().createTask(task);
System.out.println("---------------------------> Task started: " + task.getId());
taskanaEjb.getTaskService().claim(task.getId());
System.out.println("---------------------------> Task claimed: " + taskanaEjb.getTaskService().getTask(task.getId()).getOwner());
taskanaEjb.getTaskService().completeTask(task.getId());
System.out.println("---------------------------> Task completed");
}
use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class TaskanaEjb method triggerRollback.
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException {
Task task = taskService.newTask(null);
ObjectReference objRef = new ObjectReference();
objRef.setCompany("aCompany");
objRef.setSystem("aSystem");
objRef.setSystemInstance("anInstance");
objRef.setType("aType");
objRef.setValue("aValue");
task.setPrimaryObjRef(objRef);
taskService.createTask(task);
System.out.println("---------------->" + task.getId());
throw new RuntimeException();
}
use of pro.taskana.impl.ObjectReference in project taskana by Taskana.
the class TaskanaRestTest method startTask.
@GET
public Response startTask() throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException, InvalidWorkbasketException, TaskAlreadyExistException, InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {
Workbasket workbasket = taskanaEjb.getWorkbasketService().newWorkbasket("key", "cdiDomain");
workbasket.setName("wb");
workbasket.setType(WorkbasketType.PERSONAL);
taskanaEjb.getWorkbasketService().createWorkbasket(workbasket);
Classification classification = classificationService.newClassification("TEST", "cdiDomain", "t1");
taskanaEjb.getClassificationService().createClassification(classification);
Task task = taskanaEjb.getTaskService().newTask(workbasket.getKey());
task.setClassificationKey(classification.getKey());
ObjectReference objRef = new ObjectReference();
objRef.setCompany("aCompany");
objRef.setSystem("aSystem");
objRef.setSystemInstance("anInstance");
objRef.setType("aType");
objRef.setValue("aValue");
task.setPrimaryObjRef(objRef);
Task result = taskanaEjb.getTaskService().createTask(task);
logger.info(result.getId() + ":" + result.getOwner());
return Response.status(200).entity(result.getId()).build();
}
Aggregations