Howto get Process Definition version by deploymentId?

Hello!

Please tell me, is it possible to find out information about the process definition using the deployment Id?

For now, I found only API method GET /deployment/{id}

{
  "id": "someDeploymentId",
  "name": "deploymentName",
  "source": "process application",
  "deploymentTime": "2013-04-23T13:42:43.000+0200"
}
``` but it returns only half of the information that we got after POST /deployment/create


{
“links”: [
{
“method”: “GET”,
“href”: “http://localhost:38080/rest-test/deployment/aDeploymentId”,
“rel”: “self”
}
],
“id”: “aDeploymentId”,
“name”: “aName”,
“source”: “process application”,
“deploymentTime”: “2013-01-23T13:59:43.000+0200”,
“tenantId”: null,
“deployedProcessDefinitions”: {
“aProcDefId”: {
“id”: “aProcDefId”,
“key”: “aKey”,
“category”: “aCategory”,
“description”: “aDescription”,
“name”: “aName”,
“version”: 42,
“resource”: “aResourceName”,
“deploymentId”: “aDeploymentId”,
“diagram”: “aResourceName.png”,
“suspended”: true,
“tenantId”: null,
“versionTag”: null
}
},
“deployedCaseDefinitions”: null,
“deployedDecisionDefinitions”: null,
“deployedDecisionRequirementsDefinitions”: null
}



In our case, we  exclude duplication of processes in the engine by using parameters "deployment-name" and "enable-duplicate-filtering", because sometimes a repeated post request with an identical scheme may be sent. If it happens, the engine returns
{
    "links": [
        {
            "method": "GET",
            "href": "https://dev.ap.mts-corp.ru/engine-rest/deployment/41300c13-7ecc-11ee-baa6-2aa02eb2c3b6",
            "rel": "self"
        }
    ],
    "id": "41300c13-7ecc-11ee-baa6-2aa02eb2c3b6",
    "name": "asd2",
    "source": null,
    "deploymentTime": "2023-11-09T06:50:22.714+0000",
    "tenantId": null,
    "deployedProcessDefinitions": null,
    "deployedCaseDefinitions": null,
    "deployedDecisionDefinitions": null,
    "deployedDecisionRequirementsDefinitions": null
}


Thus, we can use only deployment Id, name and tenant=id to find the process version, id, key

Даша, привет!

ю кэн юз зис.

ProcessDefinition processDefinition = camunda.getRepositoryService().createProcessDefinitionQuery()
                .processDefinitionVersion(dto.getProcessDefinitionVersion())
                .singleResult();

sorry.
this is correct

ProcessDefinition processDefinition = camunda.getRepositoryService().createProcessDefinitionQuery()
                .deploymentId(deploymentId)
                .singleResult();