I use Model API to define process and I faced with problem that process is deployed every time, even if its definition was not changed.
As I can see resolving resources to deploy, also due to their potential changes is implemented here:
org.camunda.bpm.engine.impl.cmd.DeployCmd#resolveResourcesToDeploy
This method use also another method
org.camunda.bpm.engine.impl.cmd.DeployCmd#resourcesDiffer
which compares two XML process definitions - existing, and new (potentially the same as existing). But when these XMLs are generated by Model API, all element ids are generated on the fly and are different for every single deploy of the same process definition - e.g.
<incoming>sequenceFlow_5727473e-da38-4075-a0ac-2167d2b60869</incoming>
<bpmndi:BPMNDiagram id="BPMNDiagram_316dd423-39b4-4eb3-a4aa-2dde2c43152a">
<bpmndi:BPMNShape bpmnElement="..." id="BPMNShape_99f63448-ae44-4d4a-a315-f42d253188a9">
Hence, every generated process definition XML by Model API is different from previous and is deployed every time.
Deployment realisation in my code:
repositoryService
.createDeployment()
.name("shop-deployment")
.source("shop")
.tenantId("shop")
.enableDuplicateFiltering(true)
.addModelInstance("shop.bpmn", modelInstance)
.deploy()
Does anyone know how to handle it?
Camunda v. 7.11