What is the best way to change history process variable?

Hello everyone!

My team and I are using Camunda on one of our production projects, and we run in the following situation:

We have a variable in the process called groups - this variable determines the candidateGroup of a user task.

In our previous release, we had 3 groups (for ex.): [Group-1, Group-2, Group-3].
But in the current release, those three group names changed to [Group_One, Group_Two, Group_Three].

To support the previous release processes we want to change old groups variables to new on (Group-1 → Group_One, etc.).
What is the best way to do that? Manual SQL query, or HistoryService? (what I can see from the doc, we don’t have a possibility to change variables via HistoryService)

1 Like

Hi @Leocete
welcome to the forum.
Interesting usecase, we don’t really expect people to need to change the historical data so I don’t think it’s possible form an API perspective. I think directly changeing it in the database might be your best bet. Make sure to back it up first :slight_smile:

3 Likes

I think you don’t want to change historic variables, but rather the runtime ones. There is API for that. But IMO it would be too much of a hassle. I’d rather change the app code and check for the values “Group_1” etc. and change them into “Group_One” etc. on the fly.

Hello,

I previously had such scenario in one of my projects. Like Nial said your best option would be the database query (Native SQL on the table) I imagine that wouldn’t be too hard to execute. If you’re using the java apis you can always add mappers to your classes as well.

Goodluck!

3 Likes