Using Scripts in Isight ModelsYou can use scripts in a number of places in Isight models to customize behavior. You can use scripts in the following places:
Available Scripting LanguagesIsight supports two scripting languages.
Both languages provide access to parameters (or the value of a parameter), to select global variables that provide access to the Isight SDK, and to arbitrary Java classes and objects; however, the way in which they provide access differs slightly for each language. Jython is the recommended scripting language. It has a simpler syntax and more flexible type system than DynamicJava. DynamicJava is provided for backward compatibility with existing models. Script ExecutionThe script is evaluated statement-by-statement at run time until the last statement completes. When the script's last statement completes, the Script component is considered to have finished successfully. If any statement gets an error or the script throws an uncaught exception, the Script component is considered to have failed. The standard exception to throw to indicate a failure is RtException. For example, using Jython syntax: if not resultsUsable: raise RtException("the results are not usable") Note: Scripts should be written carefully so as to not interfere with the environment used to execute them. For example, scripts cannot contain calls to System.exit() or Runtime.getRuntime().exit(), because these method calls would terminate the supporting Isight Gateway or SIMULIA Execution Engine station. |