Interface ProcessFlowService
A process flow is a collection of tasks and elements that can be assigned or executed based on the underlying process flow definition. A process flow is identified by a name and context. It is associated with and scoped to a context in which it is defined. Examples of a process flow context are organization, project, and analysis.
-
Method Summary
Modifier and TypeMethodDescriptionActivates the specified process flow.voidReleases any cached information about the query that is associated with the current search.copyProcessFlow(ProcessFlowCopyInfo copyInfo) Copies the process flow with the specified source process flow identifier.createProcessFlow(String contextId, String processFlowName, String processDefinitionKey) Creates a process flow at the specified context using the latest deployed version of the process flow definition.createProcessFlowManifest(String id, FileCreateInfo manifestFileCreateInfo) Creates a process flow manifest file for the process flow with the identifier in the repository.voidDeletes the process flow with the specified identifier.booleanIndicates whether the process flow with the specified name exists at the context.Gets all process flows that the user is authorized to view.Gets all of the process flows that the user is authorized to view.getMyProcessFlowDescriptorsByContext(String contextId, boolean includeChildren) Gets all of the process flows that are owned by the current user at a context, and (optionally) below.Gets the process flow with the specified identifier.getProcessFlowByNameAndContext(String contextId, String processFlowName) Gets the process flow with the specified name at the specified context.getProcessFlowDescriptorsByContext(String contextId, boolean includeChildren) Gets the process flows at the context and (optionally) below.intGets the maximum number of process flow results to return in a single request.getSearchResults(int fromRow, int toRow) Gets a range of results after callingsearch(ProcessFlowQuery).search(ProcessFlowQuery query) Searches the process flows based on the specified query.Suspends the specified process flow.updateProcessFlow(ProcessFlow processFlow) Updates the process flow.
-
Method Details
-
getProcessFlowDescriptorsByContext
Set<ProcessFlowDescriptor> getProcessFlowDescriptorsByContext(String contextId, boolean includeChildren) throws ProcessFlowContextNotFoundException Gets the process flows at the context and (optionally) below. This method requires the current user to have read access to the context. The current user must have either the Manage Process Flows privilege or the Administer Process Flows privilege to see the process flows that are owned by others. If the user does not have either of these privileges, only process flows that the user owns are returned. If the context does not exist, an empty set is returned.- Parameters:
contextId- The identifier of the context.includeChildren- Indicates whether to retrieve the process flows for the context's children.- Returns:
- A set of process flows.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow does not exist at the specified context.ProcessFlowContextNotFoundException
-
getAllProcessFlowDescriptors
Set<ProcessFlowDescriptor> getAllProcessFlowDescriptors()Gets all process flows that the user is authorized to view.- Returns:
- A set of process flows.
-
getMyProcessFlowDescriptors
Set<ProcessFlowDescriptor> getMyProcessFlowDescriptors()Gets all of the process flows that the user is authorized to view.- Returns:
- A set of process flows.
-
getMyProcessFlowDescriptorsByContext
Set<ProcessFlowDescriptor> getMyProcessFlowDescriptorsByContext(String contextId, boolean includeChildren) throws ProcessFlowContextNotFoundException Gets all of the process flows that are owned by the current user at a context, and (optionally) below. This method requires that the current user have Read access to the context. If the context does not exist, an empty set is returned.- Parameters:
contextId- The identifier of the context.includeChildren- Indicates whether the context children's process flows are retrieved.- Returns:
- A set of ProcessFlowDescriptor objects.
- Throws:
ProcessFlowContextNotFoundException
-
exists
Indicates whether the process flow with the specified name exists at the context. Returns True, if the process flow exists and the user is authorized to view the process flow.- Parameters:
contextId- The identifier of context.processFlowName- The name of the process flow.- Returns:
- True, if the process flow exists and the user is authorized to view the process flow, False otherwise.
-
getProcessFlowByNameAndContext
ProcessFlow getProcessFlowByNameAndContext(String contextId, String processFlowName) throws ProcessFlowNotFoundException Gets the process flow with the specified name at the specified context.- Parameters:
contextId- The identifier of the context.processFlowName- The name of the process flow.- Returns:
- The process flow.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the specified name does not exist at the specified context.
-
getProcessFlowById
Gets the process flow with the specified identifier.- Parameters:
id- The identifier of the process flow.- Returns:
- The process flow.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist.ProcessFlowException- Thrown when there is an issue when getting the process flow.
-
createProcessFlow
ProcessFlow createProcessFlow(String contextId, String processFlowName, String processDefinitionKey) throws ProcessFlowExistsException, ProcessDefinitionNotFoundException, ProcessFlowContextNotFoundException Creates a process flow at the specified context using the latest deployed version of the process flow definition.- Parameters:
contextId- The identifier of the context in which to create the process flow.processFlowName- The name of the process flow.processDefinitionKey- The key of the process flow definition. This is the id value in the process flow definition file.- Returns:
- The created process flow.
- Throws:
ProcessFlowExistsException- Thrown when a process flow with the name exists in the context.ProcessDefinitionNotFoundException- Thrown when a deployed process flow definition does not exist with the identifier in the context.ProcessFlowContextNotFoundException- Thrown when the process flow context does not exist.
-
updateProcessFlow
ProcessFlow updateProcessFlow(ProcessFlow processFlow) throws ProcessFlowNotFoundException, InvalidProcessFlowStateException, ProcessFlowException, ProcessFlowExistsException Updates the process flow.- Parameters:
processFlow- The process flow.- Returns:
- The updated process flow.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist.InvalidProcessFlowStateException- Thrown when the process flow is in an invalid state to update the process flow.ProcessFlowException- Thrown when there is an issue when updating the process flow.ProcessFlowExistsException- Thrown when a process flow with the name exists at the context.
-
deleteProcessFlow
Deletes the process flow with the specified identifier.- Parameters:
id- The identifier of the process flow.- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist at the context.ProcessFlowException- Thrown when there is an issue when deleting the process flow.
-
createProcessFlowManifest
String createProcessFlowManifest(String id, FileCreateInfo manifestFileCreateInfo) throws ProcessFlowNotFoundException, ProcessFlowManifestCreateException, ProcessFlowException Creates a process flow manifest file for the process flow with the identifier in the repository.- Parameters:
id- The identifier of the process flow.manifestFileCreateInfo- The method to add the new process flow manifest file (such as major version or minor version). Specifying null defaults to a major version.- Returns:
- The path to the process flow manifest file.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist at the context.ProcessFlowManifestCreateException- Thrown when there is an issue when creating a process flow manifest file.ProcessFlowException- Thrown when there is an issue when creating the process flow manifest file.
-
activateProcessFlow
ProcessFlow activateProcessFlow(String id) throws ProcessFlowNotFoundException, ProcessFlowException Activates the specified process flow.- Parameters:
id- The identifier of the process flow.- Returns:
- The activated process flow.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist.ProcessFlowException- Thrown when there is an issue when activating the process flow.
-
suspendProcessFlow
Suspends the specified process flow. If any job tasks are running at the time of the suspension, they are cancelled.- Parameters:
id- The identifier of the process flow.- Returns:
- The suspended process flow.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist.ProcessFlowException- Thrown when there is an issue when suspending the process flow.
-
copyProcessFlow
ProcessFlow copyProcessFlow(ProcessFlowCopyInfo copyInfo) throws ProcessFlowNotFoundException, ProcessFlowExistsException, ProcessFlowCopyException Copies the process flow with the specified source process flow identifier. A new name must be specified. Other copy options include whether to activate the process flow when copied and whether to include the source process flow's process data and attachments.- Parameters:
copyInfo- The options and details needed to copy a process flow.- Returns:
- The copied process flow.
- Throws:
ProcessFlowNotFoundException- Thrown when a process flow with the identifier does not exist.ProcessFlowExistsException- Thrown when a process flow with the name exists in the context.ProcessFlowCopyException- Thrown when there is an issue when copying the process flow.
-
search
Searches the process flows based on the specified query. The returned results information contains the row count in which to request pageable lists of process flows by callinggetSearchResults(int, int). When the results are no longer required, callclearSearchResults()to release any server-side resources related with the query.Note: Only one query can be active at a time for each client. The results that are generated for the query can be used to iterate through the results by calling
getSearchResults(int, int). But if the same client calls this method again, a new set of results is generated and the previous results are no longer valid.- Parameters:
query- The criteria to query process flows.- Returns:
- The results of a process flow search.
- Throws:
ProcessFlowSearchException- Thrown when there is an issue when searching process flows.
-
getSearchResults
List<ProcessFlowSearchResultItem> getSearchResults(int fromRow, int toRow) throws ProcessFlowSearchException Gets a range of results after callingsearch(ProcessFlowQuery). Thefrom rowandto rowvalues must be between 1 and the total rows that are retrieved by the query. This is considered apageof results, and therefore, apageableresults model.Note: The maximum number of records that can be returned for a single page is available by calling
getSearchPageSizeLimit(). The default maximum is 5000.- Parameters:
fromRow- The starting row number to include in the results. The value must be greater than 0.toRow- The ending row number to include in the results. The value must be less than or equal to the total row count. The total number that is retrieved must be less than or equal to the page size limit.- Returns:
- The list of process flow items that satisfy the query and the rows that are specified.
- Throws:
ProcessFlowSearchException- Thrown when there is an issue when searching process flows.
-
clearSearchResults
void clearSearchResults()Releases any cached information about the query that is associated with the current search. This must be called once in afinallyblock for each call tosearch(ProcessFlowQuery). If the results no longer exist when this method is called, then this method returns without further action. -
getSearchPageSizeLimit
int getSearchPageSizeLimit()Gets the maximum number of process flow results to return in a single request. The default is 5000.- Returns:
- The page size limit.
-