Query tasks from nested case task

Hi everyone

I have the following scenario:

  • 2 CMMN cases (case1 and case2)
  • case1 has a case task used to call case2
  • case1 passes the businessKey to case2 via case task

I want to retrieve all task available from an instance of case1 that is linked to an instance of case2. I would like all tasks, completed or not and from both instances.

:question: Is possible to do it only using caseInstanceBusinessKey from TaskQuery?

If no, how could it be done?

Thanks a lot :slight_smile:

Hi @milyiyo,

I am not sure whether I understand your requirement correctly. Could you please elaborate more on this?

However, the TaskQuery would return only active human tasks. I think, you should try to use the HistoricActivityInstanceQuery.

Cheers,
Roman