![]() (Boolean, String, Integer, Double, Long, Float, Short, Byte, Character, BigDecimal, BigInteger, Date, Math, Calendar, GregorianCalendar, StringBuilder, StringBuffer, and ETLLogger) The following classes and packages are allowed by default: Groovy jobs/functions are analyzed at runtime, using only certain classes that are considered safe. In Jedox, Groovy runs in sandbox mode to ensure high security for your environment. ScriptHandler.execute(dimScript,"Demo",variables) But when the script is split into two lines, Groovy is able to understand the type and the script is executed successfully.įor example, the following line will result in an error:Ĭom. scriptHandler = conn.getScriptHandler() When getting a scriptHandler and then running execute on it in the same line, Groovy is not able to tell that this is a method we want to execute. There are two security layers: one that is enforced before a script is executed (static checks), and a second at runtime while executing the script. Example InputĪs of Jedox 2022.1, Groovy Sandbox mode is enabled by default in all Jedox environments. By the end of this article you find a list of the allowed classes and packages for Groovy sandbox. \tomcat\webapps\etlserver\WEB-INF\lib_external. ![]() Additional external Groovy (and Java) libraries can be used by adding the corresponding jar-files to the folder. Note that Groovy does not support any UI interactions, such as pop-ups. In this case, a RowNumber function should be added to the input list of the script function so that it is always unique.ĭocumentation on Groovy syntax and a list of all keywords can be found here.īesides the functionality offered by Groovy (and Java), specific Jedox Integrator functionality can be used via the Jedox Integrator Scripting API.Īll standard Groovy functions are supported. random value functions, use of setProperty()/getProperty(). This may lead to wrong values if the script doesn't depend only on the input values, e.g. Note: for performance reasons, the Groovy function internally buffers the results, so that a script is executed only once for the same set of input values. The result of the function is determined in the script with a return statement.Ī script that is intended to be interruptible by Integrator Server must use Java's sleep method, e.g. empty string for string data type, 0 for integer data type, etc. If checked, then a specific fallback for the data type used in the function will be used, e.g. This is necessary if the result depends on the row number or a random number generator.ĭefines a fallback value to be used when the incoming value is NULL. If not set, the script is always evaluated for all rows. If set, the function results are cached and the script is not evaluated for identical input values (default). All of the above data types are possible the assignment of a type is optional. The following data types exist: double, short, int, long, byte, string, float, object. This is especially helpful for numerical inputs and calculations. If necessary, a type conversion of the input data is done before the script is executed (with the exception of Object type, which does no conversion and keeps the input type). "Currency" an alias name is obligatory (otherwise the Groovy script would assign the value to the Java class).Ī type can be assigned to each input field that defines the type of the Groovy variable in the script. If the name in the input is identical to a class in a standard Java library e.g. As best practice the variable name should be in lower camel case e.g. Note: we recommend you use the alias name. For example, "_input1" can be used for the first input field and "_input2" for the second. Additionally, the variable name in the form "_input" can also be used where is the position of the input field.In that case, it must be a valid Groovy identifier name. If no alias is defined, then the name of the input field is the Groovy variable name.The alias is a valid Groovy identifier name. The alias must not start with a number and must not be a Groovy keyword (e.g. Valid characters for an alias are uppercase and lowercase letters, numbers and the symbols "_" and "$". If an alias is defined for the input field, it defines the Groovy variable name. ![]() The input fields can be used in the script as Groovy variables under the following conditions: ![]() Function EditorĪccess the Function Editor through FieldTransform. More information about the Groovy programming language is available at. It is also suitable for mathematical calculations. The Groovy function can be used to program very individual transformations implemented at runtime. It is characterized by its dynamic typing, high execution speed and good integration into the Java Virtual Machine. Groovy is a scripting language that is closely based on Java syntax, but also allows a simplified syntax. This function is used to execute a script in the Groovy programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |