Redeploy dmn with new version

I would like to change deployed dmn table by this one comes from controller, also the version must be changed.
For example, i have deployed dmn table named test_dmn.dmn with version 1. I upload new test_dmn.dmn from springboot controller to camunda. after all, i would like to get deployed new test_dmn.dmn table with version 2 (instead of old test_dmn.dmn table with version 1).

This code works for deployment, but i would like to do it by using java code, not rest api calling. From controller i tryed to delete existing deployment, and create it again, but it doesn’t work.

ProcessEngine processEngine = ProcessEngineConfiguration
        .createStandaloneProcessEngineConfiguration()
        .setJdbcUrl("jdbc:h2:./camunda-db/process-engine;DB_CLOSE_DELAY=1000")
        .setDatabaseSchemaUpdate("true")
        .setJobExecutorActivate(true)
        .buildProcessEngine();
    
    processEngine.getRepositoryService()
        .createDeployment()
        .addClasspathResource("dmn/test.dmn")
        .deploy();
    

If you deploy a DMN model it first looks to too see if one with the same key already exists, if there is none, it becomes version 1. If during the deployment the DMN table find another record with the same key it will automatically create a new version of that DMN table.

Is this what you’re experiencing?

Thanks. I solved this issue by just deploying a new version dmn with the same key.

repositoryService.createDeployment().addInputStream(file.getOriginalFilename(), file.getInputStream())
.deploy();

1 Like