// pre-compile script if we have it as text
if (reader != null) {
ScriptEngine engine = this.scriptEngineFactory.getScriptEngine();
if (engine instanceof Compilable) {
Compilable compilable = (Compilable) engine;
this.compiledScript = compilable.compile(scriptText);
LOG.debug("Using compiled script: {}", this.compiledScript);
}
}
} catch (IOException e) {
throw new ScriptEvaluationException("Cannot load " + scriptLanguage + " script from resource: " + scriptResource, e);