mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-2905] Added JSDocs for process services (#3292)
* [ADF-2905] Added JSDocs for process services * [ADF-2905] Added missing return value in tasklist service
This commit is contained in:
committed by
Eugenio Romano
parent
641f7d9695
commit
d361c7ddd8
@@ -30,6 +30,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Gets all filters defined for a Process App.
|
||||
* @param appId ID of the target app
|
||||
* @returns Array of filter details
|
||||
*/
|
||||
getProcessFilters(appId: number): Observable<FilterProcessRepresentationModel[]> {
|
||||
return Observable.fromPromise(this.callApiProcessFilters(appId))
|
||||
@@ -48,6 +49,7 @@ export class ProcessFilterService {
|
||||
* Retrieves the process filter by ID.
|
||||
* @param filterId ID of the filter
|
||||
* @param appId ID of the target app
|
||||
* @returns Details of the filter
|
||||
*/
|
||||
getProcessFilterById(filterId: number, appId?: number): Observable<FilterProcessRepresentationModel> {
|
||||
return Observable.fromPromise(this.callApiProcessFilters(appId))
|
||||
@@ -60,6 +62,7 @@ export class ProcessFilterService {
|
||||
* Retrieves the process filter by name.
|
||||
* @param filterName Name of the filter
|
||||
* @param appId ID of the target app
|
||||
* @returns Details of the filter
|
||||
*/
|
||||
getProcessFilterByName(filterName: string, appId?: number): Observable<FilterProcessRepresentationModel> {
|
||||
return Observable.fromPromise(this.callApiProcessFilters(appId))
|
||||
@@ -71,6 +74,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Creates and returns the default filters for an app.
|
||||
* @param appId ID of the target app
|
||||
* @returns Default filters just created
|
||||
*/
|
||||
public createDefaultFilters(appId: number): Observable<FilterProcessRepresentationModel[]> {
|
||||
let runningFilter = this.getRunningFilterInstance(appId);
|
||||
@@ -114,6 +118,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Creates and returns a filter that matches "running" process instances.
|
||||
* @param appId ID of the target app
|
||||
* @returns Filter just created
|
||||
*/
|
||||
public getRunningFilterInstance(appId: number): FilterProcessRepresentationModel {
|
||||
return new FilterProcessRepresentationModel({
|
||||
@@ -128,6 +133,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Returns a static Completed filter instance.
|
||||
* @param appId ID of the target app
|
||||
* @returns Details of the filter
|
||||
*/
|
||||
private getCompletedFilterInstance(appId: number): FilterProcessRepresentationModel {
|
||||
return new FilterProcessRepresentationModel({
|
||||
@@ -142,6 +148,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Returns a static All filter instance.
|
||||
* @param appId ID of the target app
|
||||
* @returns Details of the filter
|
||||
*/
|
||||
private getAllFilterInstance(appId: number): FilterProcessRepresentationModel {
|
||||
return new FilterProcessRepresentationModel({
|
||||
@@ -156,6 +163,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Adds a filter.
|
||||
* @param filter The filter to add
|
||||
* @returns The filter just added
|
||||
*/
|
||||
addProcessFilter(filter: FilterProcessRepresentationModel): Observable<FilterProcessRepresentationModel> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter(filter))
|
||||
@@ -168,6 +176,7 @@ export class ProcessFilterService {
|
||||
/**
|
||||
* Calls `getUserProcessInstanceFilters` from the Alfresco JS API.
|
||||
* @param appId ID of the target app
|
||||
* @returns List of filter details
|
||||
*/
|
||||
callApiProcessFilters(appId?: number) {
|
||||
if (appId) {
|
||||
|
@@ -35,9 +35,10 @@ export class ProcessService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get process instances for a filter and optionally a process definition.
|
||||
* Gets process instances for a filter and optionally a process definition.
|
||||
* @param requestNode Filter for instances
|
||||
* @param processDefinitionKey Limits returned instances to a process definition
|
||||
* @returns List of process instances
|
||||
*/
|
||||
getProcessInstances(requestNode: ProcessFilterParamRepresentationModel, processDefinitionKey?: string): Observable<ProcessListModel> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessInstances(requestNode))
|
||||
@@ -53,8 +54,9 @@ export class ProcessService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the Process Audit information as a pdf
|
||||
* Fetches the Process Audit information as a PDF.
|
||||
* @param processId ID of the target process
|
||||
* @returns Binary PDF data
|
||||
*/
|
||||
fetchProcessAuditPdfById(processId: string): Observable<Blob> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessAuditPdf(processId))
|
||||
@@ -62,8 +64,9 @@ export class ProcessService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the Process Audit information in a json format.
|
||||
* Fetches the Process Audit information in a JSON format.
|
||||
* @param processId ID of the target process
|
||||
* @returns JSON data
|
||||
*/
|
||||
fetchProcessAuditJsonById(processId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessAuditJson(processId))
|
||||
@@ -73,6 +76,7 @@ export class ProcessService {
|
||||
/**
|
||||
* Gets Process Instance metadata.
|
||||
* @param processInstanceId ID of the target process
|
||||
* @returns Metadata for the instance
|
||||
*/
|
||||
getProcess(processInstanceId: string): Observable<ProcessInstance> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessInstance(processInstanceId))
|
||||
@@ -83,6 +87,7 @@ export class ProcessService {
|
||||
* Gets task instances for a process instance.
|
||||
* @param processInstanceId ID of the process instance
|
||||
* @param state Task state filter (can be "active" or "completed")
|
||||
* @returns Array of task instance details
|
||||
*/
|
||||
getProcessTasks(processInstanceId: string, state?: string): Observable<TaskDetailsModel[]> {
|
||||
let taskOpts = state ? {
|
||||
@@ -103,6 +108,7 @@ export class ProcessService {
|
||||
/**
|
||||
* Gets process definitions associated with an app.
|
||||
* @param appId ID of a target app
|
||||
* @returns Array of process definitions
|
||||
*/
|
||||
getProcessDefinitions(appId?: number): Observable<ProcessDefinitionRepresentation[]> {
|
||||
let opts = appId ? {
|
||||
@@ -126,6 +132,7 @@ export class ProcessService {
|
||||
* @param outcome Process outcome
|
||||
* @param startFormValues Values for the start form
|
||||
* @param variables Array of process instance variables
|
||||
* @returns Details of the process instance just started
|
||||
*/
|
||||
startProcess(processDefinitionId: string, name: string, outcome?: string, startFormValues?: FormValues, variables?: ProcessInstanceVariable[]): Observable<ProcessInstance> {
|
||||
let startRequest: any = {
|
||||
@@ -151,6 +158,7 @@ export class ProcessService {
|
||||
/**
|
||||
* Cancels a process instance.
|
||||
* @param processInstanceId ID of process to cancel
|
||||
* @returns Null response notifying when the operation is complete
|
||||
*/
|
||||
cancelProcess(processInstanceId: string): Observable<void> {
|
||||
return Observable.fromPromise(
|
||||
@@ -162,6 +170,7 @@ export class ProcessService {
|
||||
/**
|
||||
* Gets the variables for a process instance.
|
||||
* @param processInstanceId ID of the target process
|
||||
* @returns Array of instance variable info
|
||||
*/
|
||||
getProcessInstanceVariables(processInstanceId: string): Observable<ProcessInstanceVariable[]> {
|
||||
return Observable.fromPromise(
|
||||
@@ -175,6 +184,7 @@ export class ProcessService {
|
||||
* Creates or updates variables for a process instance.
|
||||
* @param processInstanceId ID of the target process
|
||||
* @param variables Variables to update
|
||||
* @returns Array of instance variable info
|
||||
*/
|
||||
createOrUpdateProcessInstanceVariables(processInstanceId: string, variables: ProcessInstanceVariable[]): Observable<ProcessInstanceVariable[]> {
|
||||
return Observable.fromPromise(
|
||||
@@ -187,6 +197,7 @@ export class ProcessService {
|
||||
* Deletes a variable for a process instance.
|
||||
* @param processInstanceId ID of the target process
|
||||
* @param variableName Name of the variable to delete
|
||||
* @returns Null response notifying when the operation is complete
|
||||
*/
|
||||
deleteProcessInstanceVariable(processInstanceId: string, variableName: string): Observable<void> {
|
||||
return Observable.fromPromise(
|
||||
|
Reference in New Issue
Block a user