public interface DocumentWorker extends AutoCloseable
When integrated into the Data Processing pipeline the Document Worker implementation is passed a defined subset of the fields that the document has. It is able to add, remove, or update the document's fields.
The fields that are passed to the Document Worker are defined in the Data Processing Action that is added to the workflow. It is possible to pass all of the document's fields to the worker.
The Document Worker may implement the BulkDocumentWorker interface instead of implementing this interface if there would be
efficiency gains to be made by processing multiple documents together. The BulkDocumentWorker interface extends this interface so the
methods of this interface must still be implemented.
| Modifier and Type | Method and Description |
|---|---|
void |
checkHealth(HealthMonitor healthMonitor)
This method provides an opportunity for the worker to report if it has any problems which would prevent it processing documents
correctly.
|
default void |
close()
This method will be called when the worker is shutting down.
|
void |
processDocument(Document document)
Processes a single document.
|
void checkHealth(HealthMonitor healthMonitor)
healthMonitor - used to report the health of the applicationvoid processDocument(Document document) throws InterruptedException, DocumentWorkerTransientException
document - the document to be processedInterruptedException - if any thread has interrupted the current threadDocumentWorkerTransientException - if the document could not be processed due to a transient issuedefault void close()
throws Exception
It should be overridden by workers which hold resources that need to be released.
Note that you should avoid throwing checked exceptions from this method as the exception specification will be removed in the next major release.
close in interface AutoCloseableException - if the worker's resources cannot be closedCopyright © 2016–2022 EntIT Software LLC, a Micro Focus company. All rights reserved.