-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.13.0-alpha1
-
None
The following part of the https://docs.camunda.org/manual/latest/user-guide/process-engine/process-versioning/#version-tag documentation provides invalid information.
The following example shows how to start a process instance of the latest process definition for a version tag:
ProcessDefinition pd = processEngine.getRepositoryService().createProcessDefinitionQuery()
.processDefinitionKey("invoice")
.versionTag("1.5-patch2")
.latest()
.singleResult();processEngine.getRuntimeService().startProcessInstanceById(pd.getId());
- There is no method #latest() in ProcessDefinitionQuery class -> The Method is called #latestVersion()
- The code snippet doesn't deliver what the introduction describes.
- Having a newer deployment of the process definition with the same key and other version tag, the query will deliver a null since the #latestVersion() method doesn't take the version tag under consideration.
Possible improvements:
- Adjust code example by showing the following snippet:
processEngine.getRepositoryService().createProcessDefinitionQuery() .processDefinitionKey("invoice") .versionTag("1.5-patch2") .orderByVersion(). .desc() .listPage(0,1);
- A JUnit test case is created in the code base that covers that scenario
- Also, please consider to clarify how the query option #latestVersion() is supposed to work in the documentation (not Java API).