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.

Note: 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).

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.

Save dialog

Results dialog

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.

External Groovy (and Java) libraries

In an on-premises installation of Jedox, additional external Groovy (and Java) libraries can be used by adding the corresponding JAR files to the folder: .\tomcat\webapps\etlserver\WEB-INF\lib_external.

Make sure that these libraries comply with your IT security guidelines and are not producing conflicts with other Java libraries that are used. In case the Groovy sandbox is active, the allowed classes and packages are listed below.

Allowed classes for Groovy Sandbox

If Groovy Sandbox is active, the following classes and packages are allowed:

  • groovy.json.*
  • groovy.sql.*
  • groovy.time.*
  • java.io.StringWriter
  • java.math.*
  • java.text.*
  • java.time.*
  • java.util.*
  • org.apache.groovy.json.internal.*
  • org.apache.poi.ss.usermodel.DateUtil
  • sun.util.calendar.*
  • com.jedox.palojlib.interfaces.*
  • com.jedox.palojlib.main.*
  • java.io.BufferedInputStream
  • java.io.ByteArrayInputStream
  • java.nio.charset.*
  • sun.nio.cs.*

Updated June 5, 2023