Skip to content

Commit d10c61f

Browse files
[DSC-2436] add method to retrive process by owner and status
1 parent 19c9da3 commit d10c61f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/app/process-page/overview/process-overview.service.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,26 @@ export class ProcessOverviewService {
9898
);
9999
}
100100

101+
/**
102+
* Retrieve processes by their owner and status
103+
* @param processStatus The status for which to retrieve processes
104+
* @param findListOptions The FindListOptions object
105+
* @param autoRefreshingIntervalInMs Optional: The interval by which to automatically refresh the retrieved processes.
106+
* Leave empty or set to null to only retrieve the processes once.
107+
*/
108+
getOwnProcessesByProcessStatus(processStatus: ProcessStatus, findListOptions?: FindListOptions, autoRefreshingIntervalInMs: number = null) {
109+
const requestParam = new RequestParam('processStatus', processStatus);
110+
const options: FindListOptions = Object.assign(new FindListOptions(), {
111+
searchParams: [requestParam],
112+
elementsPerPage: 5,
113+
}, findListOptions);
114+
115+
if (hasValue(autoRefreshingIntervalInMs) && autoRefreshingIntervalInMs > 0) {
116+
this.processDataService.stopAutoRefreshing(processStatus);
117+
return this.processDataService.autoRefreshingSearchBy(processStatus, 'own', options, autoRefreshingIntervalInMs);
118+
} else {
119+
return this.processDataService.searchBy('own', options);
120+
}
121+
}
122+
101123
}

0 commit comments

Comments
 (0)