How to get ProcessInstanceId by businessKey

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

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

1 Like