User guide
Data Integration with Sybase Avaki Studio 75
Advanced topics
Propagating name changes through the view model
If an operator name or a parameter name changes, Avaki Studio propagates the change
to all expressions that use the changed element.
Note This propagation does not apply to the code inside Custom operators, nor
does it apply to operator control variables. This issue will be addressed in an
upcoming release.
Advanced topics
Using a .jsi file to enhance your model
Avaki Studio allows you to create a special file that is included when the view model is
deployed as a data service. You can place any functions or variables you wish to access
from the expressions in your model in this file, facilitating code reuse. The file is
called a JavaScript Include, or .jsi, file. It has the same name as your Avaki view
model (.avm) file, apart from the extension.
To create a .jsi file for your view model, right-click the background in the view model
editor and choose Open JSI File from the contextual menu. Studio creates the file if it
doesn’t already exist, and opens it in a text editor. You can then edit it to include any
functions, variables, or other JavaScript code you like.
For example, say your model requires converting Date objects into integers of the format
“yyyymmdd.” You could create a function as follows, and then call it from multiple places
within your model (such as Projection column definitions):
// Convert a Date object to the form "YYYYMMDD" as an int
function dateToInt(dateObject) {
return dateObject.getFullYear() * 10000 +
(dateObject.getMonth() + 1) * 100 +
dateObject.getDate();
}