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
- YAML
- JSON
- XML
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
{
"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"
}
<condition>
<class>ScriptCondition</class>
<engineName>string</engineName>
<fieldMatcher>
<ignoreCase>false</ignoreCase>
<ignoreDiacritic>false</ignoreDiacritic>
<matchEmpty>false</matchEmpty>
<method>BASIC</method>
<negateMatches>false</negateMatches>
<partial>false</partial>
<pattern>string</pattern>
<replaceAll>false</replaceAll>
<trim>false</trim>
</fieldMatcher>
<label>string</label>
<maxReadSize>0</maxReadSize>
<script>string</script>
<sourceCharset>string</sourceCharset>
</condition>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
engineName | string | No | - |
fieldMatcher | TextMatcher | No | TextMatcher |
label | string | No | - |
maxReadSize | integer | No | 10000000 |
script | string | No | - |
sourceCharset | string | No | - |
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.