ScriptedValidateRecord
Description
This processor provides the ability to validate records in FlowFiles using the user-provided script. The script is expected to have a record as incoming argument and return with a boolean value. Based on this result, the processor categorizes the records as "valid" or "invalid" and routes them to the respective relationship in batch. Additionally the original FlowFile will be routed to the "original" relationship or in case of unsuccessful processing, to the "failed" relationship.
Tags
groovy, record, script, validate
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Record Reader * | Record Reader | Controller Service: RecordReaderFactory Implementations: AvroReader CEFReader CSVReader ExcelReader GrokReader JsonPathReader JsonTreeReader ReaderLookup ScriptedReader Syslog5424Reader SyslogReader WindowsEventLogReader XMLReader YamlTreeReader | The Record Reader to use parsing the incoming FlowFile into Records | |
Record Writer * | Record Writer | Controller Service: RecordSetWriterFactory Implementations: AvroRecordSetWriter CSVRecordSetWriter FreeFormTextRecordSetWriter JsonRecordSetWriter RecordSetWriterLookup ScriptedRecordSetWriter XMLRecordSetWriter | The Record Writer to use for serializing Records after they have been transformed | |
Script Language * | Script Engine | Groovy |
| The Language to use for the script |
Script Body | Script Body | Body of script to execute. Only one of Script File or Script Body may be used | ||
Script File | Script File | Path to script file to execute. Only one of Script File or Script Body may be used Supports Expression Language, using Environment variables. | ||
Module Directory | Module Directory | Comma-separated list of paths to files and/or directories which contain modules required by the script. Supports Expression Language, using Environment variables. |
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
failure | In case of any issue during processing the incoming flow file, the incoming FlowFile will be routed to this relationship. |
invalid | FlowFile containing the invalid records from the incoming FlowFile will be routed to this relationship. If there are no invalid records, no FlowFile will be routed to this Relationship. |
original | After successful procession, the incoming FlowFile will be transferred to this relationship. This happens regardless the FlowFiles might routed to "valid" and "invalid" relationships. |
valid | FlowFile containing the valid records from the incoming FlowFile will be routed to this relationship. If there are no valid records, no FlowFile will be routed to this Relationship. |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
mime.type | Sets the mime.type attribute to the MIME Type specified by the Record Writer |
record.count | The number of records within the flow file. |
record.error.message | This attribute provides on failure the error message encountered by the Reader or Writer. |
State Management
This component does not store state.
Restricted
Required Permission | Explanation |
---|---|
execute code | Provides operator the ability to execute arbitrary code assuming all permissions that NiFi has. |
Input Requirement
This component requires an incoming relationship.
System Resource Considerations
This component does not specify system resource considerations.
See Also
ScriptedFilterRecord, ScriptedPartitionRecord, ScriptedTransformRecord