How to get ProcessDefinitionId from a programmatic deployment?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2016 01:31 PM
Hi!
I am trying to understand versioning and process definition Ids.
I have a JUnit test case that builds a BpmnModel and deploys it twice.
I see the process definition Id is in this format:
Process.java's "id" + ":"+ version + ":" + <strong>some other number</strong>".
In my logs (see below), the "some other number" is consistently a 4 on the initial deploy and then 13 on the second deploy.
What is last part of the process definition id?
Second, because I do not know how the processDefinitionId is formed, I have to create a new Process instance and then ask it for it's definition. I want to avoid that and instead, simply call RuntimeService.getProcessDefinition(processDefinitionId) to get my ProcessDefinition object.
<code>
10:48:27,305 INFO [BpmnDeployer] Processing resource dynamic-model-redeploy.bpmn
First DeploymentId is: 1
ProcessDefinitionId for first deployment is : my-process:1:4
10:48:42,265 INFO [BpmnDeployer] Processing resource dynamic-model-redeploy.bpmn
Second DeploymentId is: 10
ProcessDefinitionId for second deployment is : my-process:2:13
<code>
I am trying to understand versioning and process definition Ids.
I have a JUnit test case that builds a BpmnModel and deploys it twice.
I see the process definition Id is in this format:
Process.java's "id" + ":"+ version + ":" + <strong>some other number</strong>".
In my logs (see below), the "some other number" is consistently a 4 on the initial deploy and then 13 on the second deploy.
What is last part of the process definition id?
Second, because I do not know how the processDefinitionId is formed, I have to create a new Process instance and then ask it for it's definition. I want to avoid that and instead, simply call RuntimeService.getProcessDefinition(processDefinitionId) to get my ProcessDefinition object.
<code>
10:48:27,305 INFO [BpmnDeployer] Processing resource dynamic-model-redeploy.bpmn
First DeploymentId is: 1
ProcessDefinitionId for first deployment is : my-process:1:4
10:48:42,265 INFO [BpmnDeployer] Processing resource dynamic-model-redeploy.bpmn
Second DeploymentId is: 10
ProcessDefinitionId for second deployment is : my-process:2:13
<code>
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2016 03:27 PM
Hi,
the "second" number id generated from idGenerator. The default id generator is org.activiti.engine.impl.db.DbIdGenerator. (incremental id genrator based on the used db.)
You can use another one if you want to.
e.g.:http://activiti.org/userguide/index.html#advanced.uuid.generator
You can get process definition id from org.activiti.engine.RepositoryService#createProcessDefinitionQuery
Regards
Martin
Regards
Martin
the "second" number id generated from idGenerator. The default id generator is org.activiti.engine.impl.db.DbIdGenerator. (incremental id genrator based on the used db.)
You can use another one if you want to.
e.g.:http://activiti.org/userguide/index.html#advanced.uuid.generator
You can get process definition id from org.activiti.engine.RepositoryService#createProcessDefinitionQuery
Regards
Martin
Regards
Martin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2016 03:43 PM
Martin,
OK, I got the repository query working with singleResult() back on the deploymentId that was generated when I did the deploy() call. With that, I am all set. Thanks a lot!
Jason
OK, I got the repository query working with singleResult() back on the deploymentId that was generated when I did the deploy() call. With that, I am all set. Thanks a lot!
Jason
