Camunda versioning problem

As i have found out camunda can’t make new deployment if something isn’t changed in bpmn, but i want to generate new deployment every time i put new war in my tomcat/webapp folder ( because i make changes in code) , how should i implement and manage versioning logic into my camunda projects ?
i have read this https://docs.camunda.org/manual/7.5/user-guide/process-engine/process-versioning/ and i have more concrete questions:

1.in which class, delegate or service should i implement versioning logic

  1. is it possible to change bpmn prosess id by code?
    3.how should i enable multiple version existence on each deployment?
    4.now i have this problem: i don’t change any bpmn data and have changed only camunda project code as a result i can’t see any new deployment in camunda cockpit when war is deployed ( i mean old dpeloyment is replaced by new one ) adn old deployments are deleted what should i do to change this behaviour?

Hi @Sally

Maybe you can user the versionTag Attribute to define your own version semantic.
Changes in this attribute will always lead to a new deployed process definition.

But now to your concrete questions.

  1. If you are using spring you could extends SpringProcessEngineConfiguration and override following method.

    @Override
     protected void autoDeployResources(ProcessEngine processEngine) {
     }
    

    You could switch of enableDuplicateFiltering when deploying like this:

    DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering(false)
    .name(deploymentName).tenantId(deploymentTenantId);

  2. I think not but I am not sure

  3. I dont understand your question

  4. Why do you want a new version of your process model if only code changed? Old process model would perfectly work with your new code. If it does not you would have to change your model and get a new version.

Best regards,

Markus

Hi @Markus , thank you for your response, but i want to know if there is any way i can make this task without spring and if it is possible to change version of my process every time war is deployed( i know this is littlle bit Unconditional but i need this solution too)?

I have used this :slight_smile:
public class Configuration extends SpringProcessEngineConfiguration{
protected void autoDeployResources(ProcessEngine processEngine) {
if (deploymentResources!=null && deploymentResources.length>0) {
RepositoryService repositoryService = processEngine.getRepositoryService();

      DeploymentBuilder deploymentBuilder = repositoryService
        .createDeployment()
        .enableDuplicateFiltering(false)
        .name("service")
        .tenantId("tenantId");
    }
}

}
but this code doesn’t help me make new versions of deployment ( every time war is deployed).

You could try to implement a subclass of ProcessEngineConfiguration and override
@Override
public ProcessEngine buildProcessEngine() {} method .

In this method you define a autoDeployResources method like spring also do.
In this method you define which resources to deploy and create your deployment

  DeploymentBuilder deploymentBuilder = repositoryService
    .createDeployment()
    .enableDuplicateFiltering(false)
    .name(deploymentName)
    .tenantId(deploymentTenantId);

The code is always called when restarting your application.

Does this help?

Best regards,

Markus

Hi @Markus thank you for your response, i guesss it is veri helpful if you are changing tenant id

Hi. I want to know if there is a way to increment the process version/versionTag using some deployment configuration instead of updating the version in each process.
Any suggestions on this?

Thanks,