Skip to main content

ScriptCondition

Evaluates a custom script that returns true or false for flow control decisions.

Notesโ€‹

Evaluates a custom script that returns true or false to determine whether a document satisfies the condition. The script has access to the document reference, content, metadata, and parse status. Supports JavaScript and other configured scripting engines.

Usageโ€‹

class: ScriptCondition
engineName: string
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
label: string
maxReadSize: 0
script: string
sourceCharset: string

Propertiesโ€‹

PropertyTypeRequiredDefault
engineNamestringNo-
fieldMatcherTextMatcherNoTextMatcher
labelstringNo-
maxReadSizeintegerNo10000000
scriptstringNo-
sourceCharsetstringNo-

Property Detailsโ€‹

engineNameโ€‹

Which scripting engine runs the script. JavaScript, lua and velocity are available out of the box; any other JSR-223 engine on the classpath can be named here, such as python with Jython installed. Required โ€” there is no default.

fieldMatcherโ€‹

Matches document fields based on specified patterns and methods. Use this to restrict the handler to operate only on fields whose names satisfy the matcher criteria.

labelโ€‹

An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing โ€” it exists purely to help identify this step, for example in large configurations or in the visual configurator.

maxReadSizeโ€‹

The maximum number of characters to read from the document content at once. Use this to limit memory usage when processing large documents.

scriptโ€‹

The script content or path to execute as part of this handler's processing logic.

sourceCharsetโ€‹

Sets the character encoding of the source document to ensure proper reading and processing.