Expressions in Operators

Many view model operators allow or require you to enter JavaScript expressions that are evaluated at runtime to configure how your view model behaves.

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.

In most cases, you can use simple expressions that evaluate to a single value. Some of these are generic, while others must evaluate to a Boolean value. Some of the advanced operators, however, require more complex, multi-line expressions.

Everywhere you can enter JavaScript expressions, you have access to an object called variables, which in turn gives you access to parameters, control variables for downstream operators, and columns in the input result sets.

WorkSpace Data Federation provides contextual menus for constructing JavaScript expressions. The menus let you click to select elements like column names, operators, global parameters, and predefined functions. For many expressions, no knowledge of JavaScript—or touch typing—is required.

JavaScript Resources

Most of the expressions you create in a typical view model are so simple that knowledge of JavaScript is unnecessary. When your view models use the more advanced features of WorkSpace Data Federation, however, you might need to better understand JavaScript and how it works. JavaScript is a powerful and flexible tool. The links below point to resources to help you acquaint yourself with the basics.

JavaScript tutorial:

http://www.wdvl.com/Authoring/JavaScript/Tutorial/

JavaScript expression tester:

http://www.arachnoid.com/javascript/interactiveJavaScript.html

JavaScript references:


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.