cancel
Showing results for 
Search instead for 
Did you mean: 

Why startprocessbyid does not support version?

yuanqixun
Champ in-the-making
Champ in-the-making
I see the javadoc,I can't see the API has any version param, should we start process of latest version every time? I think this is not alway true,right?
4 REPLIES 4

etienne
Champ in-the-making
Champ in-the-making
org.activiti.engine.RuntimeService#startProcessInstanceById(String processDefinitionId)

The processDefinitionId String consists of the process definition id as well as its version number (plus some random number).

One way to get that processDefinitionId String is to call org.activiti.engine.impl.RepositoryServiceImpl#createProcessDefinitionQuery

Etienne

yuanqixun
Champ in-the-making
Champ in-the-making
org.activiti.engine.RuntimeService#startProcessInstanceById(String processDefinitionId)

The processDefinitionId String consists of the process definition id as well as its version number (plus some random number).

One way to get that processDefinitionId String is to call org.activiti.engine.impl.RepositoryServiceImpl#createProcessDefinitionQuery

Etienne

Thank you Etienne, I'm wrong.
I just think the processDefinitionId is the process's id. Here, we use process key to find the process,right?

etienne
Champ in-the-making
Champ in-the-making
Yes, you query for the ProcessDefinition entity, from which you can then take the id and use it to start the process.

Etienne

jbarrez
Star Contributor
Star Contributor
The process definition id is uniquely pointing to one process definition.
Hence it makes no sense to specify a version, as it does when specifying a key.