mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
added the method to retrieve the processInstanceId based on the process instance name. (#5238)
This commit is contained in:
parent
0e2504a53f
commit
c11ce016fa
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user