cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with startProcessInstanceByKey(key,version)

holysoul
Champ in-the-making
Champ in-the-making
Dear all.
I just make a small project  to test RuntimeService.
Firstly, I deploy a work flow model with  id = "simpleTest", a simple script task just to say "1". In the database, I have a process definition with version 1.
Then the next model to say "2", also there is a version 2 process.
But when I active Runtime Service by using method startProcessInstanceByKey("simpleTest","1"), why did the process still say "2" ?

So, I know that Activiti use findDeployedLatestProcessDefinitionByKey to find processDefinition, then what is the meaning of "version"? May be I misunderstand something here. Please explain for me?
2 REPLIES 2

holysoul
Champ in-the-making
Champ in-the-making
Any suggestion, please?

jbarrez
Star Contributor
Star Contributor
If you deploy a process definition with the same id, the startProcessInstanceByKey uses the latest version.

If you want to start a version specifically, use the startProcessInstanceById method instead.