Variables with Rest API


#1

Hi,
there are some topics that point the direction of this question. I have spend some days with reading but I could not answer it by that.
(I am only using the Rest API. No Java.)
How can I set a variable on the scope of a runnig token?
I tried to set a local variable on an execution. But this variable is lost after completion.
I also tried to set “localVariables” on complete. But this does not do anything.

So what I want: (Except of globar variables)
A token runs through the process with its own data context. If it is splitted on a junktion every resulting token “knows” only what was set before and its own data. If those tokens are joined again, the resulting token should know everything of the joined tokens. (Dublicated variable names are by mistake in design or junk.)
Is this behavoir possible with camunda?


#2

Hi @DavidThird,

you can set a local variable with this REST call: https://docs.camunda.org/manual/7.10/reference/rest/execution/local-variables/put-local-variable/.

It is expected that this variable will be deleted after the scope is finished: https://docs.camunda.org/manual/7.10/user-guide/process-engine/variables/#variable-scopes-and-variable-visibility.

You have to add some listener to handle the variables before joining.

Hope this helps, Ingo