Sample lifecycle action Java classes
FileNet P8 provides sample Java™ class files you can use when developing your Java class files. This enables you to incorporate these code fragments into trigger events for any of the three object types by adding the appropriate trigger event functions calls for your Java class. By default, the Content Engine installation program copies these files under the following file path:
<drive>:/Program Files/Filenet/Content Engine/samples
There are three sample classes available:
- JavaEventHandler: Implements the EventActionHandler interface and overrides the OnEvent method. When this method is invoked, it creates a file named myFile.txt in the C:\ drive. This file writes the following message: Event received. Event Name =xxx. Event owner = xxx.
- LCAHandler: Implements the DocumentLifecycleActionHandler interface and overrides all the methods defined in the interface. When either of the methods is invoked, it writes a message on the console with the name of the method invoked.
- DCAHandler: Implements the DocumentClassifier interface and overrides the classify method. When this method is invoked, it creates a file named myFile.txt in the C:\ drive. This file writes the following message: Event received. Event Name = xxx. Event owner = xxx.
See Working with Subscriptions, Working with Lifecycle-related Objects, and Working with Document Classification-related Objects in the Developer Help for additional details and examples.