HistoricTaskInstanceQuery processDefinitionId(String processDefinitionId); = id in the xml file?
HistoricTaskInstanceQuery processDefinitionKey(String processDefinitionKey); = the file name? HistoricTaskInstanceQuery processDefinitionName(String processDefinitionName); = the name in the xml file?
Because you then can point to the id attribute of your process definition. processDefinitionId points to the internal database id of the process instance.