Variables in Expressions

Often you will need to create variables when constructing view models, particularly as the complexity of the model grows or as you use more advanced operators such as Iterator. WorkSpace Data Federation provides a JavaScript object named variables, which lets you store any variables you wish to use across multiple operators.

Refer to any variables using the following syntax to guarantee their uniqueness across your model:

variables.<operatorInstanceName>.<variableName>

The “operatorInstanceName” referred to should be the name of the operator where the variable is declared.

You can either enter variable names directly in your expressions, or you can use the expressions menu to enter the name of any downstream variable.

Note: Variables that you declare in a given operator are only available (are only in scope) to operators that are upstream in the flow from that operator. Operators that are downstream from that operator or on a different branch of the flow cannot access your variable. If you need to use a variable across multiple branches, for example, you can declare it in your model’s .jsi file.

In the expressions that you enter, it’s OK to update variables defined downstream, as long as they’re not control variables. However:


Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.