Old process being used


#1

I have run into an issue where I get a ClassNotFoundException when trying to start a new process. The class mentioned in the exception was moved to a different package a while ago and our new version of the process reflects this change. We had deployed the new process and things were working correctly but at some point, something happened and we now get this error. Our database is used by several developers and it could be that someone deployed an earlier branch to test/fix something. However, our latest release contains the correct process but we are still getting this error.

I am trying to find out what happens to the bpmn files when they are loaded into the engine. Do they get saved in the database? If yes, which table/column are they saved in?

In the ACT_RE_PROCDEF table, I see the name of the process and the version and deployment id. The deployment id in the ACT_RE_DEPLOYMENT table shows when this was deployed.

Thanks


#2

Hi,

Welcome to the forum.

I am trying to find out what happens to the bpmn files when they are loaded into the engine. Do they get saved in the database? If yes, which table/column are they saved in?

Yes, the BPMN process is stored via the repository service. I believe they are stored as a byte arrays.

The engine version controls BPMN process models. If you deploy a changed process model, the repository will contain the old and the new version. There are three attributes to be aware of;
The process key - This does not change and is set in the model
Process Version Id - this is system generated by the repository service
Semantic Version - this is set in the modeller.

When starting a process, you can determine which version to use. For example, you can;
Start a specific version by using the Process Version Id.
Start the latest deployed version based on the Process Key
Start a particular semantic version based on the process key and the Semantic version.

You can find more detail here [1]

So how are you starting your processes? Are you using the REST API?

regards

Rob

[1] https://docs.camunda.org/manual/7.11/user-guide/process-engine/process-versioning/#which-version-will-be-used


#3

Thanks Rob.

We start the process by the Process Key using the Java API.

It seems that an older version of the bpmn file was deployed along with our application at some point. However, we have since deployed the latest version of the bpmn file and our application. Since we are starting the process using the Process Key, the thought was that the version that we deployed last would be started but that does not seem to be the case.

Is there a way to force the deployment of the latest file? Maybe if we just make a minor change (like put a comment somewhere) and start the application that will be enough to force the deployment of the latest bpmn file?


#4

Hi,

Yes if you start by key, it should default to the latest version…

Other reasons why this may not be the case;
The process model has the executable flag set to false, hence there is no new version.
The process model has a syntax error and is not actually deployed, so an old version is used.

Also be aware of async continuations. If you stop the engine with outstanding processinstances, they will persist on startup and thus inflight process instances will use the old version. This can lead to class not found if you have removed a class.

I believe just about any change in the model will result in a new version, consider updating the semantic version and redeploying…

regards

Rob


#5

Hi @amansaini19,

I inspected your situtation of redeploying an old version of the process model when some developers share the same database during development.

Each restart of the server will deploy the model of the restarter as the latest version to the shared database. It will confuse the other user.

You should use individual databases during development. The most easy way to get them is using H2 as file based database:
jdbc:h2:./camunda-db;DB_CLOSE_DELAY=-1;MVCC=TRUE;DB_CLOSE_ON_EXIT=FALSE

Hope this helps, Ingo