Package com.aquima.web.rest.v1.service
Class TaskService
java.lang.Object
com.aquima.web.rest.v1.service.ProcessServiceBase
com.aquima.web.rest.v1.service.TaskService
-
Field Summary
Fields inherited from class com.aquima.web.rest.v1.service.ProcessServiceBase
dateConverter, repository
-
Method Summary
Modifier and TypeMethodDescriptionstatic TaskService
forPaged
(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ITaskModel, Task> converter, IDateConverter dateConverter, IResourceLinker<Task> linker, PaginatorFactory paginatorFactory) Creates an instance of this service usable in the /tasks endpointstatic TaskService
forSingle
(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ITaskModel, Task> converter, IDateConverter dateConverter) Creates an instance of this service usable in the GET /task/{taskId} endpointstatic TaskService
forUpdate
(com.aquima.interactions.process.impl.ProcessCaseRepository repository, com.blueriq.component.api.ApplicationFinder applicationFinder, IResourceConverter<com.aquima.interactions.process.dao.ITaskModel, Task> converter, IDateConverter dateConverter) Creates an instance of this service usable in the PUT /tasks/{taskId} endpointvoid
This method is responsible for composing aTask
resource after a taskIdvoid
getTasks
(PagedObject<Task> pagedObject, Integer page, Integer pageSize, String sort, String attributes, List<ResourceFilter> resourceFilters, boolean includeAll) This method is responsible for composing aPagedObject
object for a taskvoid
updateTask
(Task task, long taskId, com.aquima.interactions.project.IUserData userData) This method is responsible for updating a task from status STARTED to OPEN.Methods inherited from class com.aquima.web.rest.v1.service.ProcessServiceBase
fillAttributes, fillAttributes, fillAttributes, getAttributeValue, getCaseIds, getIncluded, getInstanceIds, getInstanceIds
-
Method Details
-
forPaged
public static TaskService forPaged(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ITaskModel, Task> converter, IDateConverter dateConverter, IResourceLinker<Task> linker, PaginatorFactory paginatorFactory) Creates an instance of this service usable in the /tasks endpoint- Parameters:
repository
- the case repositoryconverter
- converter from task query result to task resourcesdateConverter
- the date converterlinker
- HATEOAS linker for taskpaginatorFactory
- paginator factory- Returns:
- an instance of this service configured for use in the GET /tasks endpoint
-
forSingle
public static TaskService forSingle(com.aquima.interactions.process.impl.ProcessCaseRepository repository, IResourceConverter<com.aquima.interactions.process.dao.ITaskModel, Task> converter, IDateConverter dateConverter) Creates an instance of this service usable in the GET /task/{taskId} endpoint- Parameters:
repository
- the case repositoryconverter
- converter from task query result to task resourcesdateConverter
- the date converter- Returns:
- an instance of this service configured for use in the /task/{taskId} endpoint
-
forUpdate
public static TaskService forUpdate(com.aquima.interactions.process.impl.ProcessCaseRepository repository, com.blueriq.component.api.ApplicationFinder applicationFinder, IResourceConverter<com.aquima.interactions.process.dao.ITaskModel, Task> converter, IDateConverter dateConverter) Creates an instance of this service usable in the PUT /tasks/{taskId} endpoint- Parameters:
repository
- the case repositoryapplicationFinder
- the portal engineconverter
- converter from task query result to task resourcesdateConverter
- the date converter- Returns:
- an instance of this service configured for use in the /task/{taskId} endpoint
-
getTasks
public void getTasks(PagedObject<Task> pagedObject, Integer page, Integer pageSize, String sort, String attributes, List<ResourceFilter> resourceFilters, boolean includeAll) This method is responsible for composing aPagedObject
object for a task- Parameters:
pagedObject
- The object which will be pagedpage
- Page numberpageSize
- Page sizesort
- Sort columns. Comma separatedattributes
- the attributesresourceFilters
- A list ofResourceFilter
objects. Used for filteringincludeAll
- whether to include all
-
getTask
This method is responsible for composing aTask
resource after a taskId- Parameters:
task
- TheTask
resourcetaskId
- The id of the taskattributes
- the attributesincludeAll
- whether to include all
-
updateTask
This method is responsible for updating a task from status STARTED to OPEN. The task resource is not updated from the database. After this method is invoked, it should be re-checked (in a separate transaction) whether the task still exists. If the task was the last required task in the case and the task is automatic, the case may have been closed and the task deleted.- Parameters:
task
- TheTask
resourcetaskId
- The id of the taskuserData
- the user data
-