User guide
View models in Avaki Studio
4 Data Integration with Sybase Avaki Studio
Data flow
Discussions of view model operators and especially of variables rely on the notion that
in a view model, data flows toward the result—and generally from left to right. We use
the terms upstream and downstream to indicate direction in a view model:
• Upstream: away from the Result element
• Downstream: towards the Result element
Thus, in a view model with two Select operators, the downstream Select is the one
closer to the Result element.
Parameters and control variables
View models can have variables, which can be used by the various operators. Vari-
ables include global parameters (that is, parameters to the entire view model/data ser-
vice) and control variables introduced by some operators (such as Iterator and
Custom). These variables, along with the values of columns in the inputs to an opera-
tor, can be referenced in the expressions that control the behavior of the operators.
Some examples are the where expression in a Select operator and the column defini-
tions in a Projection operator.
Control variables introduced by various operators are accessible only to expressions in
upstream operators—that is, in operators to the left, whose output directly or indirectly
flows into the operator that introduces the control variable.
View model parameters are accessible from any place in the view model where you
can enter expressions. View model parameter values can be singletons or arrays. To
see a list of data types you can use for parameters, click in the Type column of the
parameters tab and pull down the menu.
You can view, enter, and modify view model parameters on the Parameters tab in the
bottom pane of Studio’s Avaki perspective. See “Using global parameters” on page 63.
Expressions in operators
Several view model operators allow or require you to enter JavaScript expressions that
control the behavior of the operator. For example, to use Projection to combine two
columns, you might write an expression that concatenates the columns, multiplies
them, or filters out the larger of two values.