Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 9 Next »

This processor allows the execution of custom scripts.

Configuration

{
  "language" : "groovy",
  "script" : "println \"RECORD (Groovy):\" + data\nout.put(\"data\", \"data-\"+data.findField(\"c2:/contentId\").get().asText())\nout.put(\"record\", \"record-\"+record.id)\nprintln \"NEW:\" + out",
  "name" : "Scripting",
  "type" : "scripting"
}

Configuration Parameters

language (Required, String) Code scripting language. Options are: groovy, javascript and jython.

script (Required, String) code to process each record.

Data Cache

The Data Cache is a simple Map<String, Object> structure shared with all jobs in the same seed execution.

Usage

def cachedValue = cache.computeIfAbsent("key") { key -> ~"([Gg])roovy" }
if (data.getId() =~ cachedValue) {
  // Do something with the match
}
  • No labels