camunda / camunda-docs

Camunda 8 Documentation, including all components and features
https://docs.camunda.io/
Other
54 stars 184 forks source link

Help users understand variable scoping for multi-instance output collection #288

Open korthout opened 3 years ago

korthout commented 3 years ago

We should inform users that the output collection variable of a multi-instance element hides any variables of that same name at a higher scope. For example, this means you should not use the same variable name for both the input collection and the output collection (see https://github.com/camunda-cloud/zeebe/issues/7330#issuecomment-865968125)

The documentation already mentions:

outputCollection defines the name of the variable under which the collected output is stored (e.g. results). It is created as a local variable of the multi-instance body and gets updated when an instance is completed. When the multi-instance body is completed, the variable is propagated to its parent scope.

We should add some notations about what it means to have a local variable.

akeller commented 2 years ago

I think this is somewhat related to @Falko's #420. Is this something you could work on documenting? Or do we need to pull in @menski to help prioritize and assign?

korthout commented 2 years ago

@akeller If I find some time for it, I might pick this up, but I'm not immediately planning on it. If we feel there is a strong need for this, we should explicitly prioritize and plan it.