Supporting expressions for collection variables

Input variables passed for expression evaluation can be repeating or non-repeating.For repeating variables, expression is evaluated once for each instance of variable. Expression results are returned as a collection. Input variables can repeat at different levels, for example one of the input variables can be a list of strings and another can be a list of list of strings. For handling the difference in collection hierarchy, expression manager flattens these collection variables into a two-dimensional array where each row represents input parameters required to evaluate the expression. Expression is evaluated on each row and result is organized according to the hierarchy of the input variables.

All the collection variables being used for expression evaluation are part of the single hierarchy. When examining a path from root element to the deepest collection variable, all collection variables falls on this path. For non-repeating variables, there is no such restriction. If any of the input variable instance is null, the result is set to null for this instance. Expression evaluation for other instances is done in a normally. At any given level and index, all variables contain same number of elements. If a variable does not contain elements at a certain level, that variable is not compared for that level.

// Ethnio survey code removed