KeyViewRouteOnFileType

A processor that uses KeyView to route FlowFiles based on the format of the associated file. The processor also adds fields to the document metadata, containing the KeyView document class, KeyView format code, and a MIME type string.

NOTE: The processor only writes information about the file format to the document metadata when you license the processor with an IDOL License Server.

Properties

Name Description
KeyView Filter Service A KeyViewFilterServiceImpl that manages the location of the KeyView binaries and temporary file storage.
IDOL License Service

An IdolLicenseServiceImpl that provides a way to communicate with an IDOL License Server.

Document Registry Service A DocumentRegistryServiceImpl controller service that manages and updates a document registry database. The processor unregisters any FlowFiles that are discarded as a result of matching the "Discard File Types" property.
Routing Scheme

Specifies how to route FlowFiles:

  • Media - Media files are routed to a relationship named "media", other known formats are routed to "unmatched", and unknown formats are routed to "unknown". Media files are files that belong to KeyView class 4 (raster image), 9 (sound), or 20 (movie). In this mode you cannot set Discard File Types or define custom relationships.
  • Custom - You define relationships for the file types that you want to route, as described below.
Discard File Types

The processor discards any FlowFiles where the associated file matches these file types. You can specify a KeyView document class, a KeyView format code, or a MIME-type string (in the same way as for dynamic properties, below).

The easiest way to configure the processor and select the file types to discard is by using the advanced configuration interface (click ADVANCED).

outgoing_relationship_name

You can add as many custom properties as you need. Each one defines a new outgoing relationship. You can specify the files to route to that relationship using a KeyView document class, a KeyView format code, or a MIME-type string.

For example:

  • The KeyView document class for word processor files is 1, so to route all word processor files to the relationship WordProcessorFiles, add a property named WordProcessorFiles and set the value to ${file.keyview.class:equals('1')}.
  • The KeyView format code for PDF files is 230, so to route all PDF files to the relationship PDFFiles, add a property named PDFFiles and set the value to 230.
  • The content-type for Microsoft Excel files is application/x-ms-excel, so to route all Excel files to the relationship MyExcelFiles, add a property named MyExcelFiles and set the value to application/x-ms-excel.

You can route multiple file types to a single relationship. For example, you could create a property named ImageFiles and set the value to 5,83,143,238 (the KeyView format codes for BMP, TIFF, JPEG, and PNG files, respectively).

The easiest way to configure the processor and select the file types to route is by using the advanced configuration interface (click ADVANCED).

Do not configure properties with overlapping formats. FlowFiles that match more than one property are routed to the "failure" relationship. For example, this could occur if you have one property that matches the KeyView word processor document class and another property that matches the Microsoft Word format code.

Relationships

Name Description
failure

A failure occurred while attempting to detect the file format of a file referenced or contained by the FlowFile. A failure can occur when the FlowFile has an invalid format.

A FlowFile is also routed to the "failure" relationship when:

  • An associated file matches more than one property that you have configured.
  • It has more than one associated file, and these would individually be routed to different relationships.

Other types of failure result in the FlowFile being returned to the incoming queue.

media This relationship is available only when you set Routing Scheme to "Media". It is equivalent to adding a custom property named "media" with the value ${file.keyview.class:in('4','9','20')}.
property_name The file format matches exactly one of the properties you configured. The FlowFile is routed to the relationship with the corresponding name.
unknown The file format is not known to KeyView.
unmatched The file format is known but does not match any of the properties that you have configured, or the FlowFile has no associated file.

NOTE: A FlowFile that has multiple associated files that would individually be routed to the same outgoing relationship is routed as a whole to that relationship.