Interface ProcessesService


public interface ProcessesService
  • Method Details

    • getWorkFlows

      List<WorkFlow> getWorkFlows(ProcessesFilter filter, int offset, int limit, long userIdentityId) throws IllegalAccessException
      Retrieves a list of accessible WorkFlows, for a selected user, by applying the designated filter. The returned results will be of type WorkFlow only. The ownerId of filter object will be used to select the list of accessible WorkFlows to retrieve.
      Parameters:
      filter - ProcessesFilter that contains filtering criteria
      offset - Offset of the result list
      limit - Limit of the result list
      userIdentityId - Identity technical identifier of the user acessing files
      Returns:
      List of WorkFlow
      Throws:
      IllegalAccessException - when the user isn't allowed to access documents of the designated ownerId
    • countWorkFlows

      int countWorkFlows(ProcessesFilter filter, long userIdentityId) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • getWorkFlow

      WorkFlow getWorkFlow(long id, Long userIdentityId) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • createWorkFlow

      WorkFlow createWorkFlow(WorkFlow workFlow, long userId) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • updateWorkFlow

      WorkFlow updateWorkFlow(WorkFlow workFlow, long userId) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      IllegalArgumentException
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getWorks

      List<Work> getWorks(long userIdentityId, WorkFilter workFilter, int offset, int limit) throws Exception
      Retrieves list of filtered works
      Parameters:
      userIdentityId - user identity id
      workFilter - works filter
      offset - offset of the work lits result
      limit - limit of the queried result list
      Returns:
      List of Work
      Throws:
      Exception
    • getWorkFlowByProjectId

      WorkFlow getWorkFlowByProjectId(long projectId)
    • createWork

      Work createWork(Work work, long userId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Creates a work from new work object or from exiting work draft
      Parameters:
      work - Work Object
      userId - user id
      Returns:
      Work
      Throws:
      IllegalAccessException - when the user can't add a request to the work's process
      org.exoplatform.commons.exception.ObjectNotFoundException - when the work's project isn't a process project
    • updateWork

      Work updateWork(Work work, long userId) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      IllegalArgumentException
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • deleteWorkflowById

      @Deprecated(forRemoval=true) void deleteWorkflowById(Long workflowId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use deleteWorkflowById(Long, long) instead, which checks the user's permission. Since 7.3.0, for removal.
      Delete a workflow by its given Id, without any permission check.
      Parameters:
      workflowId - : workflow id
    • deleteWorkflowById

      void deleteWorkflowById(Long workflowId, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Delete a workflow by its given Id, when the user is allowed to delete it
      Parameters:
      workflowId - workflow id
      userIdentityId - user identity id
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the workflow doesn't exist
      IllegalAccessException - when the user isn't allowed to delete it
    • countWorksByWorkflow

      int countWorksByWorkflow(Long projectId, Boolean isCompleted) throws Exception
      Parameters:
      projectId - : Tasks project id
      isCompleted - : filter by completed and uncompleted tasks
      Returns:
      Filtered tasks count
      Throws:
      Exception
    • deleteWorkById

      @Deprecated(forRemoval=true) void deleteWorkById(Long workId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use deleteWorkById(Long, long) instead, which checks the user's permission. Since 7.3.0, for removal.
      Delete a work by its given id, without any permission check.
      Parameters:
      workId - : Work id
    • deleteWorkById

      void deleteWorkById(Long workId, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Delete a work by its given id, when the user is its creator or a manager of its process
      Parameters:
      workId - Work id
      userIdentityId - user identity id
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the work doesn't exist
      IllegalAccessException - when the task isn't a request of a process, or when the user isn't allowed to manage it
    • updateWorkCompleted

      @Deprecated(forRemoval=true) Work updateWorkCompleted(Long workId, boolean completed)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use updateWorkCompleted(Long, boolean, long) instead, which checks the user's permission. Since 7.3.0, for removal.
      update the completed property of the task of a work to completed or uncompleted, without any permission check.
      Parameters:
      workId - work id
      completed - work completed property, can be true or false
      Returns:
      Work
    • updateWorkCompleted

      Work updateWorkCompleted(Long workId, boolean completed, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      update the completed property of the task of a work to completed or uncompleted, when the user is its creator or a manager of its process
      Parameters:
      workId - work id
      completed - work completed property, can be true or false
      userIdentityId - user identity id
      Returns:
      Work
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the work doesn't exist
      IllegalAccessException - when the task isn't a request of a process, or when the user isn't allowed to manage it
    • createWorkDraft

      Work createWorkDraft(Work work, long userId) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Creates a work draft
      Parameters:
      work - Work draft object
      userId - user identity
      Returns:
      Work
      Throws:
      IllegalArgumentException
      org.exoplatform.commons.exception.ObjectNotFoundException - when the draft's process doesn't exist
      IllegalAccessException - when the user can't add a request to the draft's process
    • updateWorkDraft

      Work updateWorkDraft(Work work, long userId) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Updates a work draft
      Parameters:
      work - Work draft object
      userId - user identity
      Returns:
      Work
      Throws:
      IllegalArgumentException
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException - when the user isn't the draft's creator
    • getWorkDrafts

      List<Work> getWorkDrafts(long userIdentityId, WorkFilter workFilter, int offset, int limit)
      Retrieves a list of accessible WorkDraft, for a selected user
      Parameters:
      userIdentityId - user identity
      workFilter - work filter
      offset - Offset of the result list
      limit - Limit of the result list
      Returns:
      List of Work
    • deleteWorkDraftById

      @Deprecated(forRemoval=true) void deleteWorkDraftById(Long id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use deleteWorkDraftById(Long, long) instead, which checks the user's permission. Since 7.3.0, for removal.
      Deletes a work draft by its given id, without any permission check.
      Parameters:
      id - Work draft id
    • deleteWorkDraftById

      void deleteWorkDraftById(Long id, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Deletes a work draft by its given id, when the user is its creator
      Parameters:
      id - Work draft id
      userIdentityId - user identity id
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the draft doesn't exist
      IllegalAccessException - when the user isn't the draft's creator
    • getAvailableWorkStatuses

      List<WorkStatus> getAvailableWorkStatuses()
      Retrieves the list of available statuses in all workflows
      Returns:
      List of WorkStatus
    • getWorkById

      Work getWorkById(long userIdentityId, Long workId)
      Retrieves a Work by its given id
      Parameters:
      userIdentityId - user identity id
      workId - Work id
      Returns:
      Work
    • getWorkById

      Work getWorkById(long workId)
      Retrieves a request by its id, whoever asks: for the platform itself, for example the digest emails, never for a user request
      Parameters:
      workId - the request (work) id, the same as its task id
      Returns:
      the request, or null when it doesn't exist any more
    • getIllustrationImageById

      IllustrativeAttachment getIllustrationImageById(Long illustrationId) throws org.exoplatform.commons.file.services.FileStorageException, org.exoplatform.commons.exception.ObjectNotFoundException, IOException
      Retrieves an illustration image by its given id
      Parameters:
      illustrationId - illustration file id
      Returns:
      IllustrativeAttachment
      Throws:
      org.exoplatform.commons.file.services.FileStorageException
      org.exoplatform.commons.exception.ObjectNotFoundException
      IOException
    • getWorkFlowIllustration

      IllustrativeAttachment getWorkFlowIllustration(long workflowId, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException, org.exoplatform.commons.file.services.FileStorageException, IOException
      Retrieves the illustration image of a workflow, when the user can see the workflow: a member of its participators or of its request creators, or a processes manager
      Parameters:
      workflowId - workflow id
      userIdentityId - user identity id
      Returns:
      IllustrativeAttachment
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the workflow doesn't exist or has no illustration
      IllegalAccessException - when the user can't see the workflow
      org.exoplatform.commons.file.services.FileStorageException
      IOException