Updating local variable of each task in running process

Hi, Wanted to understand if it’s possible to update local variable of each task/activity in the running process.

Regards,
Saraswati

Hi @sarahegde,

It is certainly possible…

Below docs may of help to you
https://docs.camunda.org/manual/7.5/user-guide/process-engine/variables/#variable-scopes-and-variable-visibility

Thank you. I specifically want to know if the local variable can be set on a task or activity even if the execution has not reached the task.

Did not find any example for the same. Any hints here would be helpful.

@sarahegde you can’t update the task variables if token doesn’t reached that activity or the activity was completed. You can update the variables only for the active tasks.

If the token doesn’t reached the activity then task instance won’t be created for that activity. ACT_RU_TASKINSTANCE table will have currently active task instances. You can update the variables for only those task instances.

ok. Thanks.