docs: public void deleteHistoricTaskInstancesByProcessInstanceIds(List<String> processInstanceIds, boolean deleteVariableInstances) {
  
      CommandContext commandContext = Context.getCommandContext();
  
      if (deleteVariableInstances) {
        getHistoricVariableInstanceManager().deleteHistoricVariableInstancesByTaskProcessInstanceIds(processInstanceIds);
      }
  
      getHistoricDetailManager()
          .deleteHistoricDetailsByTaskProcessInstanceIds(processInstanceIds);
  
      commandContext
          .getCommentManager()
          .deleteCommentsByTaskProcessInstanceIds(processInstanceIds);
  
      getAttachmentManager()
          .deleteAttachmentsByTaskProcessInstanceIds(processInstanceIds);
  
      getHistoricIdentityLinkManager()
          .deleteHistoricIdentityLinksLogByTaskProcessInstanceIds(processInstanceIds);
  
      getDbEntityManager().deletePreserveOrder(HistoricTaskInstanceEntity.class, "deleteHistoricTaskInstanceByProcessInstanceIds", processInstanceIds);
    }