Class TaskService

java.lang.Object
com.aquima.web.rest.v1.service.ProcessServiceBase
com.aquima.web.rest.v1.service.TaskService

public class TaskService extends ProcessServiceBase
  • Method Details Link icon

    • forPaged Link icon

      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 repository
      converter - converter from task query result to task resources
      dateConverter - the date converter
      linker - HATEOAS linker for task
      paginatorFactory - paginator factory
      Returns:
      an instance of this service configured for use in the GET /tasks endpoint
    • forSingle Link icon

      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 repository
      converter - converter from task query result to task resources
      dateConverter - the date converter
      Returns:
      an instance of this service configured for use in the /task/{taskId} endpoint
    • forUpdate Link icon

      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 repository
      applicationFinder - the portal engine
      converter - converter from task query result to task resources
      dateConverter - the date converter
      Returns:
      an instance of this service configured for use in the /task/{taskId} endpoint
    • getTasks Link icon

      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 a PagedObject object for a task
      Parameters:
      pagedObject - The object which will be paged
      page - Page number
      pageSize - Page size
      sort - Sort columns. Comma separated
      attributes - the attributes
      resourceFilters - A list of ResourceFilter objects. Used for filtering
      includeAll - whether to include all
    • getTask Link icon

      public void getTask(Task task, long taskId, String attributes, boolean includeAll)
      This method is responsible for composing a Task resource after a taskId
      Parameters:
      task - The Task resource
      taskId - The id of the task
      attributes - the attributes
      includeAll - whether to include all
    • updateTask Link icon

      public void updateTask(Task task, long taskId, com.aquima.interactions.project.IUserData userData)
      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 - The Task resource
      taskId - The id of the task
      userData - the user data