Interface ProcessesService
public interface ProcessesService
-
Method Summary
Modifier and TypeMethodDescriptionintcountWorkFlows(ProcessesFilter filter, long userIdentityId) intcountWorksByWorkflow(Long projectId, Boolean isCompleted) createWork(Work work, long userId) Creates a work from new work object or from exiting work draftcreateWorkDraft(Work work, long userId) Creates a work draftcreateWorkFlow(WorkFlow workFlow, long userId) voiddeleteWorkById(Long workId) Deprecated, for removal: This API element is subject to removal in a future version.voiddeleteWorkById(Long workId, long userIdentityId) Delete a work by its given id, when the user is its creator or a manager of its processvoidDeprecated, for removal: This API element is subject to removal in a future version.usedeleteWorkDraftById(Long, long)instead, which checks the user's permission.voiddeleteWorkDraftById(Long id, long userIdentityId) Deletes a work draft by its given id, when the user is its creatorvoiddeleteWorkflowById(Long workflowId) Deprecated, for removal: This API element is subject to removal in a future version.usedeleteWorkflowById(Long, long)instead, which checks the user's permission.voiddeleteWorkflowById(Long workflowId, long userIdentityId) Delete a workflow by its given Id, when the user is allowed to delete itRetrieves the list of available statuses in all workflowsgetIllustrationImageById(Long illustrationId) Retrieves an illustration image by its given idgetWorkById(long userIdentityId, Long workId) Retrieves a Work by its given idgetWorkDrafts(long userIdentityId, WorkFilter workFilter, int offset, int limit) Retrieves a list of accessible WorkDraft, for a selected usergetWorkFlow(long id, Long userIdentityId) Retrieves a workflow by its id, with the user's permissions on itgetWorkFlowByProjectId(long projectId) getWorkFlowIllustration(long workflowId, long userIdentityId) 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 managergetWorkFlows(ProcessesFilter filter, int offset, int limit, long userIdentityId) Retrieves a list of accessible WorkFlows, for a selected user, by applying the designated filter.getWorks(long userIdentityId, WorkFilter workFilter, int offset, int limit) Retrieves list of filtered worksbooleanisProcessesAdministrator(long userIdentityId) Checks whether a user administers every process: a member of /platform/processes or a platform administrator creates, edits and deletes any process, and manages any requestupdateWork(Work work, long userId) updateWorkCompleted(Long workId, boolean completed) Deprecated, for removal: This API element is subject to removal in a future version.useupdateWorkCompleted(Long, boolean, long)instead, which checks the user's permission.updateWorkCompleted(Long workId, boolean completed, long userIdentityId) 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 processupdateWorkDraft(Work work, long userId) Updates a work draftupdateWorkFlow(WorkFlow workFlow, long userId)
-
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 typeWorkFlowonly. The ownerId of filter object will be used to select the list of accessible WorkFlows to retrieve.- Parameters:
filter-ProcessesFilterthat contains filtering criteriaoffset- Offset of the result listlimit- Limit of the result listuserIdentityId-Identitytechnical identifier of the user acessing files- Returns:
ListofWorkFlow- Throws:
IllegalAccessException- when the identity isn't an active user
-
countWorkFlows
- Throws:
IllegalAccessException
-
getWorkFlow
Retrieves a workflow by its id, with the user's permissions on it- Parameters:
id- workflow technical identifieruserIdentityId- the user's identity technical identifier, or null for a read made by the platform itself, whose permissions are all false- Returns:
- the
WorkFlow, or null when it doesn't exist - Throws:
IllegalAccessException- when the identity isn't an active user, or neither participates in the workflow nor may add a request to it
-
isProcessesAdministrator
Checks whether a user administers every process: a member of /platform/processes or a platform administrator creates, edits and deletes any process, and manages any request- Parameters:
userIdentityId-Identitytechnical identifier of the user- Returns:
- true when the user administers every process
- Throws:
IllegalAccessException- when the identity isn't an active user
-
createWorkFlow
- Throws:
IllegalAccessException
-
updateWorkFlow
WorkFlow updateWorkFlow(WorkFlow workFlow, long userId) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
IllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getWorks
List<Work> getWorks(long userIdentityId, WorkFilter workFilter, int offset, int limit) throws Exception Retrieves list of filtered works -
getWorkFlowByProjectId
-
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 ObjectuserId- user id- Returns:
Work- Throws:
IllegalAccessException- when the user can't add a request to the work's processorg.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:
IllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
deleteWorkflowById
Deprecated, for removal: This API element is subject to removal in a future version.usedeleteWorkflowById(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 iduserIdentityId- user identity id- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the workflow doesn't existIllegalAccessException- when the user isn't allowed to delete it
-
countWorksByWorkflow
- Parameters:
projectId- : Tasks project idisCompleted- : filter by completed and uncompleted tasks- Returns:
- Filtered tasks count
- Throws:
Exception
-
deleteWorkById
Deprecated, for removal: This API element is subject to removal in a future version.usedeleteWorkById(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 iduserIdentityId- user identity id- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the work doesn't existIllegalAccessException- when the task isn't a request of a process, or when the user isn't allowed to manage it
-
updateWorkCompleted
Deprecated, for removal: This API element is subject to removal in a future version.useupdateWorkCompleted(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 idcompleted- 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 idcompleted- work completed property, can be true or falseuserIdentityId- user identity id- Returns:
Work- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the work doesn't existIllegalAccessException- 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 objectuserId- user identity- Returns:
Work- Throws:
IllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundException- when the draft's process doesn't existIllegalAccessException- 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 objectuserId- user identity- Returns:
Work- Throws:
IllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException- when the user isn't the draft's creator
-
getWorkDrafts
Retrieves a list of accessible WorkDraft, for a selected user -
deleteWorkDraftById
Deprecated, for removal: This API element is subject to removal in a future version.usedeleteWorkDraftById(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 iduserIdentityId- user identity id- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the draft doesn't existIllegalAccessException- when the user isn't the draft's creator
-
getAvailableWorkStatuses
List<WorkStatus> getAvailableWorkStatuses()Retrieves the list of available statuses in all workflows- Returns:
ListofWorkStatus
-
getWorkById
Retrieves a Work by its given id- Parameters:
userIdentityId- user identity idworkId- Work id- Returns:
Work
-
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.FileStorageExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionIOException
-
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 iduserIdentityId- user identity id- Returns:
IllustrativeAttachment- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the workflow doesn't exist or has no illustrationIllegalAccessException- when the identity isn't an active user, or can't see the workfloworg.exoplatform.commons.file.services.FileStorageExceptionIOException
-
deleteWorkById(Long, long)instead, which checks the user's permission.