Constants Summary | |
---|---|
Number | #DATETIME Constant to be used when the type of a variable needs to be specified. |
Number | #INTEGER Constant to be used when the type of a variable needs to be specified. |
Number | #MEDIA Constant to be used when the type of a variable needs to be specified. |
Number | #NUMBER Constant to be used when the type of a variable needs to be specified. |
Number | #TEXT Constant to be used when the type of a variable needs to be specified. |
Property Summary | |
---|---|
String | #defaultValue The default value of the variable. |
String | #name The name of the variable. |
Number | #variableType The type of the variable. |
Method Summary | |
---|---|
UUID | #getUUID() Returns the UUID of the variable |
Constants Details |
---|
DATETIME |
Constant to be used when the type of a variable needs to be specified. |
Returns Number |
Samplevar dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME); dateVar.defaultValue = 'now'; application.output(globals.gDate); // Prints the current date and time. |
INTEGER |
Constant to be used when the type of a variable needs to be specified. |
Returns Number |
Samplevar intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER); intVar.defaultValue = 997; application.output(globals.gInt); // Prints 997 |
MEDIA |
Constant to be used when the type of a variable needs to be specified. |
Returns Number |
Samplevar mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA); mediaVar.defaultValue = 'new Array(1, 2, 3, 4)'; application.output(globals.gMedia); // Prints out the array with four elements. |
NUMBER |
Constant to be used when the type of a variable needs to be specified. |
Returns Number |
Samplevar numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER); numberVar.defaultValue = 192.334; application.output(globals.gNumber); // Prints 192.334 |
TEXT |
Constant to be used when the type of a variable needs to be specified. |
Returns Number |
Samplevar txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT); txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value. application.output(globals.gText); // Prints 'some text' (without quotes). |
Property Details |
---|
defaultValue |
The default value of the variable. It is interpreted as a JS expression. For INTEGER variables it can be an integer constant, like 10 for example. |
Returns String |
Samplevar intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER); intVar.defaultValue = 997; application.output(globals.gInt); // Prints 997 var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER); numberVar.defaultValue = 192.334; application.output(globals.gNumber); // Prints 192.334 var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME); dateVar.defaultValue = 'now'; application.output(globals.gDate); // Prints the current date and time. var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT); txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value. application.output(globals.gText); // Prints 'some text' (without quotes). var mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA); mediaVar.defaultValue = 'new Array(1, 2, 3, 4)'; application.output(globals.gMedia); // Prints out the array with four elements. |
name |
The name of the variable. |
Returns String |
Samplevar gVar = solutionModel.newGlobalVariable('gtext', JSVariable.TEXT); gVar.name = 'anotherName'; gVar.defaultValue = '"default text"'; // The next two lines will print the same output. application.output(globals[gVar.name]); application.output(globals.anotherName); |
variableType |
The type of the variable. Can be one of: TEXT, INTEGER, NUMBER, DATETIME or MEDIA. |
Returns Number |
Samplevar g = solutionModel.newGlobalVariable('gtext',JSVariable.TEXT); globals.gtext = 'some text'; g.variableType = JSVariable.DATETIME; globals.gtext = 'another text'; // This will raise an error now, because the variable is not longer of type text. |
Method Details |
---|
getUUID |
UUID getUUID () |
Returns the UUID of the variable |
Returns UUID |
Samplevar dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME); application.output(dateVar.getUUID().toString()); |