com.filenet.api.engine
Interface DocumentClassifier
-
public interface DocumentClassifier
An interface to be implemented to automatically classify documents of a particular content type. When a document of the targeted content type is checked in with AUTO_CLASSIFY specified, the implementation assigns the applicable Content Engine class to the document. ADocumentClassifier
implementation runs on the server.When implementing a document classifier, consider the following points:
- A document classifier runs asynchronously.
- An exception thrown by a document classifier will be logged to the server,
and the asynchronous action will remain in the
QueueItem
and retried as often as set in the RetryCount property. - To update a source object, you must first fetch the persisted instance of the source object before updating it. Do not update the source object passed to the document classifier.
- You can implement a document classifier as a Java or JavaScript component.
You can check in a Java document classifier as a
CodeModule
object, or you can specify a Java document classifier in the classpath of the application server where the Content Engine is running.
-
-
Method Detail
-
classify
void classify(Document doc) throws EngineRuntimeException
Assigns a Content Engine class to theDocument
object passed to the method. Typically, this involves parsing the content of the document and mapping metadata from the content to properties of the Content Engine class. This method is executed by the server when both of the following events occur:- The document specified by the
doc
parameter is checked in by calling itscheckin
method with theautoClassify
parameter set toAUTO_CLASSIFY
. - A
DocumentClassificationAction
object exists whoseMimeType
property value is identical to that of theMimeType
property of the checked-in document.
- Parameters:
doc
- ADocument
object that specifies the document to auto-classify during check-in.- Throws:
EngineRuntimeException
- The document specified by the
-
-