added the method to retrieve the processInstanceId based on the process instance name. (#5238)

This commit is contained in:
Geeta Mandakini Ayyalasomayajula 2019-11-12 19:20:49 +00:00 committed by Eugenio Romano
parent 0e2504a53f
commit c11ce016fa

View File

@ -83,4 +83,18 @@ export class QueryService {
}
}
async getProcessInstanceId(processName: string, appName: string): Promise<any> {
try {
const path = '/' + appName + '/query/v1/process-instances';
const method = 'GET';
const queryParams = { name: processName }, postBody = {};
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
return data.list.entries && data.list.entries.length > 0 ? data.list.entries[0].entry.id : null;
} catch (error) {
Logger.error('Get Process Instance Id - Service error, Response: ', JSON.parse(JSON.stringify(error)).response.text);
}
}
}