public class TaskServiceImpl extends Object implements TaskService
| Constructor and Description |
|---|
TaskServiceImpl(TaskanaEngine taskanaEngine,
TaskMapper taskMapper,
ObjectReferenceMapper objectReferenceMapper) |
| Modifier and Type | Method and Description |
|---|---|
Task |
claim(String id,
String userName)
Claim an existing task.
|
Task |
complete(String id)
Set task to completed.
|
Task |
createTask(Task task)
Create a task by a task object.
|
TaskQuery |
createTaskQuery()
This method provides a query builder for quering the database.
|
Task |
getTaskById(String id)
Get the details of a task.
|
List<DueWorkbasketCounter> |
getTaskCountByWorkbasketAndDaysInPastAndState(long daysInPast,
List<TaskState> states) |
List<TaskStateCounter> |
getTaskCountForState(List<TaskState> states)
This method counts all tasks with a given state.
|
long |
getTaskCountForWorkbasketByDaysInPastAndState(String workbasketId,
long daysInPast,
List<TaskState> states)
Count all Tasks in a given workbasket with daysInPast as Days from today in
the past and a specific state.
|
List<Task> |
getTasksByWorkbasketIdAndState(String workbasketId,
TaskState taskState)
Getting a list of all Tasks which got matching workbasketIds and states.
|
List<TaskSummary> |
getTaskSummariesByWorkbasketId(String workbasketId)
Getting a short summary of all tasks in a specific workbasket.
|
Task |
setTaskRead(String taskId,
boolean isRead)
Marks a task as read.
|
Task |
transfer(String taskId,
String destinationWorkbasketId)
Transfer task to another workbasket.
|
public TaskServiceImpl(TaskanaEngine taskanaEngine, TaskMapper taskMapper, ObjectReferenceMapper objectReferenceMapper)
public Task claim(String id, String userName) throws TaskNotFoundException
TaskServiceclaim in interface TaskServiceid - task iduserName - user who claims the taskTaskNotFoundException - TODOpublic Task complete(String id) throws TaskNotFoundException
TaskServicecomplete in interface TaskServiceid - the task idTaskNotFoundException - TODOpublic Task createTask(Task task) throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException
TaskServicecreateTask in interface TaskServicetask - TODONotAuthorizedException - TODOWorkbasketNotFoundException - TODOClassificationNotFoundException - TODOpublic Task getTaskById(String id) throws TaskNotFoundException
TaskServicegetTaskById in interface TaskServiceid - the id of the taskTaskNotFoundException - TODOpublic List<TaskStateCounter> getTaskCountForState(List<TaskState> states)
TaskServicegetTaskCountForState in interface TaskServicestates - the countable statesTaskStateCounterpublic long getTaskCountForWorkbasketByDaysInPastAndState(String workbasketId, long daysInPast, List<TaskState> states)
TaskServicegetTaskCountForWorkbasketByDaysInPastAndState in interface TaskServiceworkbasketId - TODOdaysInPast - TODOstates - TODOpublic Task transfer(String taskId, String destinationWorkbasketId) throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException
TaskServicetransfer in interface TaskServicetaskId - TODOdestinationWorkbasketId - TODOTaskNotFoundException - TODOWorkbasketNotFoundException - TODONotAuthorizedException - TODOpublic List<DueWorkbasketCounter> getTaskCountByWorkbasketAndDaysInPastAndState(long daysInPast, List<TaskState> states)
getTaskCountByWorkbasketAndDaysInPastAndState in interface TaskServicepublic Task setTaskRead(String taskId, boolean isRead) throws TaskNotFoundException
TaskServicesetTaskRead in interface TaskServicetaskId - the id of the task to be updatedisRead - the new status of the read flag.TaskNotFoundException - TODOpublic TaskQuery createTaskQuery()
TaskServicecreateTaskQuery in interface TaskServiceTaskQuerypublic List<Task> getTasksByWorkbasketIdAndState(String workbasketId, TaskState taskState) throws WorkbasketNotFoundException, NotAuthorizedException, Exception
TaskServicegetTasksByWorkbasketIdAndState in interface TaskServiceworkbasketId - where the tasks need to be in.taskState - which is required for the request,WorkbasketNotFoundException - if the workbasketId can´t be resolved to a existing workbasket.NotAuthorizedException - if the current user got no rights for reading on this workbasket.Exception - if no result can be found by @{link TaskMapper}.public List<TaskSummary> getTaskSummariesByWorkbasketId(String workbasketId) throws WorkbasketNotFoundException
TaskServicegetTaskSummariesByWorkbasketId in interface TaskServiceworkbasketId - ID of workbasket where tasks are located.WorkbasketNotFoundException - if a Workbasket can´t be located.Copyright © 2017. All rights reserved.