ExecuteGroovyScript

Description:

Experimental Extended Groovy script processor. The script is responsible for handling the incoming flow file (transfer to SUCCESS or remove, e.g.) as well as any flow files created by the script. If the handling is incomplete or incorrect, the session will be rolled back.

Additional Details...

Tags:

script, groovy, groovyx

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Script FilePath to script file to execute. Only one of Script File or Script Body may be used
Supports Expression Language: true (will be evaluated using variable registry only)
Script BodyBody of script to execute. Only one of Script File or Script Body may be used
Failure strategyrollback
  • rollback
  • transfer to failure
What to do with unhandled exceptions. If you want to manage exception by code then keep the default value `rollback`. If `transfer to failure` selected and unhandled exception occurred then all flowFiles received from incoming queues in this session will be transferred to `failure` relationship with additional attributes set: ERROR_MESSAGE and ERROR_STACKTRACE. If `rollback` selected and unhandled exception occurred then all flowFiles received from incoming queues will be penalized and returned. If the processor has no incoming connections then this parameter has no effect.
Additional classpathClasspath list separated by semicolon. You can use masks like `*`, `*.jar` in file name.
Supports Expression Language: true (will be evaluated using variable registry only)

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
A script engine property to updateThe value to set it toUpdates a script engine property specified by the Dynamic Property's key with the value specified by the Dynamic Property's value. Use `CTL.` to access any controller services.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
successFlowFiles that were successfully processed
failureFlowFiles that failed to be processed

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

Required PermissionExplanation
execute codeProvides operator the ability to execute arbitrary code assuming all permissions that NiFi has.

Input requirement:

This component allows an incoming relationship.

System Resource Considerations:

None specified.

See Also:

ExecuteScript