Camunda Process definition versions

Hi,

i have a problem. I have a Spring boot project with camunda 7. I deployed numerous versions of the same process definition. Naturally i have many versions that i can see in camunda cockpit. In the project definition there is a Message catch event. That means that from time to time i get a request where i need to correlate the process instance from the message catch event and let her go in another task. I just realised i didn’t put a processes.xml file in my spring ressource folder and as a consequence when i deployed a new modification to my process definition, the job executor would not know about my active process instances from the old versions and could not correlate them and execute the jobs needed. I do not have access to the database or camunda restapi unfortunately. I tried to add the processes.xml file like this

The isDeployChangedOnly i thought it would also take the unknown old versions but it did not. If i add this file, the next process definitions and their instances will be known to the engine but i also need the old process definitions to be known as i have active process instances. Could someone help me? Could i add other thins in the processes.xml file to say to camunda to recognise also the old versions? Many thanks :slight_smile:

Hello my friend!

I don’t know if I understand your problem well, but from what I understand, I believe it would be resolved by adding the following properties to your processes.xml:

isResumePreviousVersions as true
resumePreviousBy as true

Link to the official documentation, for you to understand better:

isDeployChangedOnly is a property that only inform the camunda engine that it should not deploy files that have not had changes…

Imagine that when deploying, if this property is set to false, all your process definitions will receive a new version, and this will increase the deployment time and resource consumption of your application… if this property is set to true, It will only implement processes that have undergone any changes in relation to those that had already been implemented.

If you are unable to achieve the expected behavior with this, I suggest using Camunda’s Migration API and running a script calling it to migrate all your process instances.

Process Instance Migration API Link

https://docs.camunda.org/rest/camunda-bpm-platform/7.21/#tag/Migration

I hope this helps!

William Robert Alves

Hi William,
thank you so much for the answer. I managed to bring the active process instance from old versions of the definition the the newest by migrating them directly from the cockpit. I also added the processes.xml file. What my main goal now is: If i change something in the process definition like a retry in a task or other minor changes and i deploy the new version then i want to be certain that the instances from the old version are still active and handled correctly by the executor.This doe not happen unfortunately. If i then delete the definition deployment from the cockpit, the old process instances are back to normal…

If I understand correctly, you have a messageCorrelate that when deploying a new process is giving you an error because it is possibly trying to correlate with your last deployed process.

For the correlation to continue working in the old flows, you will need to add a correlation through the Process Definition.

    execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation("myMessageName")
            .processDefinitionId("myProcessDefinitionId")
            .processInstanceId(execution.getProcessInstanceId())
            .correlate();

With this, Camunda will understand that the process you want to correlate is another process that is not the last one implemented.

William Robert Alves

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.