How to get ProcessInstanceId by businessKey


#1

How to get the ProcessInstanceId by businessKey . This businessKey is our unique key for each execution.


#2

Hey @satya,

You can use the ProcessInstanceQuery (get it via RuntimeService#createProcessInstanceQuery() or HistoricProcessInstanceQuery (get it via HistoryService#createHistoricProcessInstanceQuery(). The queries have processInstanceBusinessKey to which you can pass your key and then you can either use singleResult() or list() to get all matching process instances.

Cheers,
Filip