Groovy Job
This job executes a script in the Groovy programming language. Groovy is a scripting language that is closely based on the Java syntax but also allows a simplified syntax. It is characterized by its dynamic typing, high execution speed, and good integration into the Java Virtual Machine.
More information about the Groovy programming language is available at http://groovy-lang.org.
Besides the various kinds of functionality, Groovy (and Java) offers specific Jedox Integrator functionality via the Jedox Integrator Scripting API. Cube cell changes made in Groovy jobs can also be audited with the API ICube.loadCell.
All standard Groovy functions are supported. Note that Groovy does not support any UI interactions, such as pop-ups.
Notes
- A script that is intended to be interrupted by Integrator Server must use Java's sleep method, e.g.
Thread.sleep(15000)
. For more information, see https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#sleep(long). - The scripting functions (undo, redo, copy, paste, and search) are only limited to the current job.
Script
This area provides a scripting window with syntax highlighting. Once you've entered your script, click Save on the toolbar. To check whether the script is valid, click Test. If your test results are good, then click Run to execute the script. The Integrator Monitor will show the results of the job.
Fail on status
If the job executes several loads or sub-jobs, the selected option defines the behavior in case of a warning or an error message in one of the loads or sub-jobs. The options are described below.
none | All subsequent loads or sub-jobs are executed even if errors or warnings occur. The job terminates with "Completed with warnings" or "Completed with errors" or "Completed successfully". |
error | In case of an error message, the job terminates without executing subsequent loads or sub-jobs and the job terminates with status "Failed". In case of warnings subsequent loads or sub-jobs are executed and the job terminates with "Completed with warnings". |
warning | In case of a warning or an error message, the job terminates without executing subsequent loads or sub-jobs and the job terminates with status "Failed". |
inherit | If the job is executed directly (without parent job) it uses failOnStatus "error". Otherwise if the job is used as a sub-job it inherits the failOnStatus of its parent job (see corresponding descriptions of these failOnStatus options above). |
Groovy scripts can also be used in FieldTransform Functions. For more information, see Groovy Function.
Allowed classes for Groovy Sandbox
In Jedox, Groovy runs in sandbox mode to ensure high security for your environment. Groovy jobs / functions are analyzed at runtime, using only certain classes that are considered safe.
Only the following classes and packages are allowed:
- com.azure.storage.blob.specialized.BlobInputStream
- com.jedox.etl.components.scriptapi.MailAPI
- com.jedox.palojlib.interfaces.*
- com.jedox.palojlib.main.*
- groovy.json.*
- groovy.sql.*
- groovy.time.*
- groovy.xml : MarkupBuilder, MarkupBuilderHelper, XmlSlurper only
- groovy.xml.slurpersupport.*
- java.io : BufferedInputStream, BufferedOutputStream, ByteArrayInputStream, BytArrayOutputStream, StringWriter only
- java.lang : Boolean, Byte, Character, Double, Long, Float, Integer, Long, Math, Object[ ], Short, String, StringBuffer, StringBuilder only
- java.math.*
- java.net.URLEncoder
- java.nio.charset.*
- java.sql.Date
- java.text.*
- java.time.*
- java.util.*
- org.apache.commons.lang3.*
- org.apache.groovy.json.internal.*
- org.apache.http.conn.EofSensorInputStream
- org.codehaus.groovy.runtime: EncodingGroovyMethods, GStringImpl only
- org.apache.poi.ss.usermodel.DateUtil
- sun.nio.cs.*
- sun.util.calendar.*
- All Java primitive types, their corresponding object and array classes
If any other class is used (e.g. java.lang.System or java.lang.ProcessBuilder), you will get an error message.
Updated November 4, 2024