public ProcessDefinitionEntity findLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("processDefinitionKey", processDefinitionKey);
    parameters.put("tenantId", tenantId);

    if (tenantId == null) {
      return (ProcessDefinitionEntity) getDbEntityManager().selectOne("selectLatestProcessDefinitionByKeyWithoutTenantId", parameters);
    } else {
      return (ProcessDefinitionEntity) getDbEntityManager().selectOne("selectLatestProcessDefinitionByKeyAndTenantId", parameters);
    }
  }
public ProcessDefinitionEntity findLatestProcessDefinitionByKeyAndTenantId ( String processDefinitionKey , String tenantId ) { Map < String , String > parameters = new HashMap < String , String > ( ) ; parameters . put ( "processDefinitionKey" , processDefinitionKey ) ; parameters . put ( "tenantId" , tenantId ) ; if ( tenantId == null ) { return ( ProcessDefinitionEntity ) getDbEntityManager ( ) . selectOne ( "selectLatestProcessDefinitionByKeyWithoutTenantId" , parameters ) ; } else { return ( ProcessDefinitionEntity ) getDbEntityManager ( ) . selectOne ( "selectLatestProcessDefinitionByKeyAndTenantId" , parameters ) ; } }
@return the latest version of the process definition with the given key and tenant id

@see #findLatestProcessDefinitionByKeyAndTenantId(String, String)