[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:
Mercy Chrysolite
2020-07-30 14:00:39 +05:30
committed by GitHub
parent f6bf60eb49
commit 46f3f0f1d1
22 changed files with 100 additions and 14 deletions

View File

@@ -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