Class AnyTasksManager

java.lang.Object
eu.c6.gibraltar.api.common.AbstractManager
eu.c6.gibraltar.api.managers.tasks.AnyTasksManager

public class AnyTasksManager extends AbstractManager
The Class AnyTasksManager to manage tasks.
  • Constructor Details

    • AnyTasksManager

      public AnyTasksManager(AnySession anySession)
      Instantiates a new Any tasks manager.
      Parameters:
      anySession - the Any user session
  • Method Details

    • getTasks

      public ScrollResult getTasks(int fromIndex, List<String> printedFields) throws Exception
      Gets the tasks.

      Returned task is limited to 25 each call.

      Parameters:
      fromIndex - the from index you want to get next 25 contents. Use ScrollResult.getTotalCount() from the result to get total count.
      printedFields - the printed fields you want to have in the result
      Returns:
      ScrollResult containing the list of abstract contents (ScrollResult.getResults()) and total count of contents ( ScrollResult.getTotalCount()).
      Throws:
      Exception - the exception if current user does not have the permission to access to tasks.
    • get

      public IAnyTask get(String taskId) throws Exception
      Gets the task item with its identifier.
      Parameters:
      taskId - the task identifier
      Returns:
      the task item
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist.
    • delete

      public boolean delete(String taskId) throws Exception
      Delete the task item using its identifier.
      Parameters:
      taskId - the task identifier
      Returns:
      boolean result if delete was a success
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist.
    • deleteAll

      public boolean deleteAll(List<String> taskIds) throws Exception
      Delete task items using their identifier.
      Parameters:
      taskIds - the list of task identifier to delete
      Returns:
      boolean result if delete was a total success
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist.
    • delegate

      public boolean delegate(String user, String... taskIds) throws Exception
      Delegate one or multiple task item using their identifier to a user.
      Parameters:
      user - the user identifier to whom the task will be delegated
      taskIds - an array of task identifier(s)
      Returns:
      boolean result if delegate was a success
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist.
    • takeAction

      public boolean takeAction(String id, AnyTaskAction action) throws Exception
      Take transition action on a task, using its identifier.
      Parameters:
      action - the transition action the task should take (AnyTaskAction)
      id - the task identifier
      Returns:
      boolean result if action was a success
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist.
    • replaceRecipients

      public boolean replaceRecipients(String id, List<String> recipients) throws Exception
      Replace the list of recipients from a supervision task identifier.
      Parameters:
      id - the supervision task identifier
      recipients - the list of valid user_name, login or group, the task should be update with
      Returns:
      boolean result if update was a success
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist or some recipients do not exist.
    • addRecipients

      public boolean addRecipients(String id, List<String> recipients) throws Exception
      Add recipients to the list of recipients from a supervision task identifier.
      Parameters:
      id - the supervision task identifier
      recipients - the list of valid user_name, login or group, the task should be update with
      Returns:
      boolean result if update was a success
      Throws:
      Exception - the exception if current user does not have permission to get it or task does not exist or some recipients do not exist.