i used the following code in activiti
NativeProcessDefinitionQuery query = repositoryService.createNativeProcessDefinitionQuery();
query.sql(" select rownum||'' as Id_,"
+" rev_, "
+" category_, "
+" name_, "
+" key_, "
+" version_, "
+" deployment_id_, "
+" resource_name_, "
+" dgrm_resource_name_, "
+" description_, "
+" has_start_form_key_, "
+" has_graphical_notation_,"
+" suspension_state_, "
+" tenant_id_ from ( select distinct '' as Id_, "
+ " 0 as rev_, "
+ " '' as category_, "
+ " def.name_, "
+ " def.key_, "
+ " 0 as version_, "
+ " '' as deployment_id_, "
+ " '' as resource_name_, "
+ " '' as dgrm_resource_name_, "
+ " '' as description_, "
+ " 0 as has_start_form_key_, "
+ " 0 as has_graphical_notation_, "
+ " 0 as suspension_state_, "
+ " '' as tenant_id_ " + " from "
+ managementService.getTableName(HistoricProcessInstance.class)
+ " RES " + " left outer join ACT_RE_PROCDEF DEF "
+ " on RES.PROC_DEF_ID_ = DEF.ID_ "
+ " WHERE (exists (select LINK.USER_ID_ "
+ " from ACT_HI_IDENTITYLINK LINK "
+ " where USER_ID_ =#{userId} "
+ " and LINK.PROC_INST_ID_ = RES.ID_)) ) ");
query.parameter("userId", SecurityUtility.getAuthenticatedUserId().toString());
but because repositoryService of camunda don’t have createNativeProcessDefinitionQuery method i dont know how do it. please help me.