docs: public ProcessDefinitionEntity getMostRecentVersionOfProcessDefinition(ProcessDefinitionEntity processDefinition) {
      String key = processDefinition.getKey();
      String tenantId = processDefinition.getTenantId();
      ProcessDefinitionEntityManager processDefinitionManager 
        = Context.getCommandContext().getProcessEngineConfiguration().getProcessDefinitionEntityManager();
  
      ProcessDefinitionEntity existingDefinition = null;
  
      if (tenantId != null && !tenantId.equals(ProcessEngineConfiguration.NO_TENANT_ID)) {
        existingDefinition = processDefinitionManager.findLatestProcessDefinitionByKeyAndTenantId(key, tenantId);
      } else {
        existingDefinition = processDefinitionManager.findLatestProcessDefinitionByKey(key);
      }
  
      return existingDefinition;
    }