[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:
Mykyta Maliarchuk
2026-08-07 10:37:57 +02:00
committed by GitHub
parent 33cf47342d
commit 1ab385a3c9
10 changed files with 253 additions and 1 deletions
@@ -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.
*