[ACS-5601] Add getProcessesAndTasksOnContent to process content service (#8940)

* [ACS-5601] Add getProcessesAndTasksOnContent to process content service

* [ACS-5601] Add docs for new method

* [ACS-5601] Fix import
This commit is contained in:
MichalKinas
2023-09-28 11:05:19 +02:00
committed by GitHub
parent 094acf77ce
commit a0c79e6c64
2 changed files with 35 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
import { ActivitiContentApi, RelatedContentRepresentation, ResultListDataRepresentationRelatedProcessTask } from '@alfresco/js-api';
import { Observable, from, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
@@ -183,6 +183,19 @@ export class ProcessContentService {
.pipe(catchError((err) => this.handleError(err)));
}
/**
* Lists processes and tasks on workflow started with provided document
*
* @param sourceId - id of the document that workflow or task has been started with
* @param source - source of the document that workflow or task has been started with
* @param size - size of the entries to get
* @param page - page number
* @return Promise<ResultListDataRepresentationRelatedProcessTask>
*/
getProcessesAndTasksOnContent(sourceId: string, source: string, size?: number, page?: number): Observable<ResultListDataRepresentationRelatedProcessTask> {
return from(this.contentApi.getProcessesAndTasksOnContent(sourceId, source, size, page)).pipe(catchError((err) => this.handleError(err)));
}
/**
* Creates a JSON representation of data.
*