Change process variable names

Hello fellow users,

I have a question which I hope you could help me with. I’m trying to change process variable names as they flow through my process model. i.e. I have a service task which returns two variables called Relation and House. Suppose I don’t want to have the variables relation and contract but I’d prefer them to be called Contact and Building. How would I go about to rename them easily; is this even possible?

Alternative option is that I use the variables as they come in my model from the service task and fulfill some business logic. After the variables have been used in the right way and fulfilled their duty I’d like to send them along with another service task but once again I’d like to send them in a different format; Contact and Building. Is either or both of these options plausible?

kind regards,

T

Hi T,

This sounds like a job for execution-local variables in combination with input/output mappings. So the service task would set the variable via DelegateExecution#setVariableLocal and the task’s output mapping would translate the variable to the name the general process expects. You can find more on mappings here: https://docs.camunda.org/manual/7.9/user-guide/process-engine/variables/#input-output-variable-mapping and on local variables here: https://docs.camunda.org/manual/7.9/user-guide/process-engine/variables/#variable-scopes-and-variable-visibility.

Cheers,
Thorben

Hi @thorben,

Thanks for your reply. I’ve already managed to get a similar result as to what I was looking for. :slight_smile:

kind regards,

T