mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[MNT-25629] Add batch document-runtime endpoint support (#12121)
* [MNT-25629] Add batch document-runtime endpoint support * [MNT-25629] cr fixes * [MNT-25629] cr fixes * [MNT-25629] add tests for api method
This commit is contained in:
@@ -232,4 +232,16 @@ describe('ProcessContentService', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should call getProcessesAndTasksOnContentBatch on contentApi with correct parameters', (done) => {
|
||||
const sourceIds = ['node1;1.0@site', 'node2;1.0@site'];
|
||||
const source = 'alfresco-1-repoAlfresco';
|
||||
|
||||
spyOn(service.contentApi, 'getProcessesAndTasksOnContentBatch').and.returnValue(Promise.resolve({ data: [] }));
|
||||
|
||||
service.getProcessesAndTasksOnContentBatch(sourceIds, source).subscribe(() => {
|
||||
expect(service.contentApi.getProcessesAndTasksOnContentBatch).toHaveBeenCalledWith(sourceIds, source, undefined, undefined);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -204,6 +204,27 @@ export class ProcessContentService {
|
||||
return from(this.contentApi.getProcessesAndTasksOnContent(sourceId, source, size, page)).pipe(catchError((err) => this.handleError(err)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch variant of getProcessesAndTasksOnContent. Accepts multiple source document ids
|
||||
* in one request (up to 500) and returns the related processes and tasks for all of them.
|
||||
*
|
||||
* @param sourceIds - ids of the documents to query process participation for (up to 500)
|
||||
* @param source - source of the documents that workflows or tasks have been started with
|
||||
* @param size - size of the entries to get
|
||||
* @param page - page number
|
||||
* @returns Observable<ResultListDataRepresentationRelatedProcessTask>
|
||||
*/
|
||||
getProcessesAndTasksOnContentBatch(
|
||||
sourceIds: string[],
|
||||
source: string,
|
||||
size?: number,
|
||||
page?: number
|
||||
): Observable<ResultListDataRepresentationRelatedProcessTask> {
|
||||
return from(this.contentApi.getProcessesAndTasksOnContentBatch(sourceIds, source, size, page)).pipe(
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a JSON representation of data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user