Class TaskService

    • Method Detail

      • 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 repository
        converter - converter from task query result to task resources
        linker - HATEOAS linker for task
        paginatorFactory - 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 repository
        converter - converter from task query result to task resources
        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.aquima.interactions.portal.IPortalEngine portalEngine,
                                            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
        converter - converter from task query result to task resources
        portalEngine - the portal engine
        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 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
        resourceFilters - A list of ResourceFilter objects. Used for filtering
      • getTask

        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
      • updateTask

        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