When is a default value for a variable nessesary

It is not as much a default value that is needed.
The object (in this case an Array of String) needs to be initialized before it can be used.
So the default value of your null-object becomes an empty, but initialised array.
Doing that in the default section is an option to do it (and to not forget it).
Another option is to do it as the first assign action.

If however, your object is filled by a return of another function, activity or workflow, you don’t have to do the initialisation, since the returning activity will have done it for you.

This pretty much counts for all object variables. Default datatypes such as a string or integer do not require this to be done by you.

For more background look into Object Oriented Programming.

1 Like