mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[ACA-3687] Implement Process definition name filter dropdown in Process List (#5870)
* [ACA-3687] Implement Process definition name filtr * Updated docs * Updated mock
This commit is contained in:
@@ -21,6 +21,7 @@ import { Observable, Subject, throwError } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ProcessInstanceCloud } from '../start-process/models/process-instance-cloud.model';
|
||||
import { BaseCloudService } from '../../services/base-cloud.service';
|
||||
import { ProcessDefinitionCloud } from '../../models/process-definition-cloud.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -57,6 +58,26 @@ export class ProcessCloudService extends BaseCloudService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the process definitions associated with an app.
|
||||
* @param appName Name of the target app
|
||||
* @returns Array of process definitions
|
||||
*/
|
||||
getProcessDefinitions(appName: string): Observable<ProcessDefinitionCloud[]> {
|
||||
if (appName || appName === '') {
|
||||
const url = `${this.getBasePath(appName)}/rb/v1/process-definitions`;
|
||||
|
||||
return this.get(url).pipe(
|
||||
map((res: any) => {
|
||||
return res.list.entries.map((processDefs) => new ProcessDefinitionCloud(processDefs.entry));
|
||||
})
|
||||
);
|
||||
} else {
|
||||
this.logService.error('AppName is mandatory for querying task');
|
||||
return throwError('AppName not configured');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a process.
|
||||
* @param appName Name of the app
|
||||
|
Reference in New Issue
Block a user