com.filenet.api.engine

Interface RetrievalEventActionHandler



  • public interface RetrievalEventActionHandler
    An interface to be implemented as an event action handler, which runs on the server. When an operation is performed on an object with a subscription, and that operation is one of the subscribed events for that subscription, the event handler will be invoked. For any event other than GetContentEvent, use the EventActionHandler interface instead.

    When implementing an event action handler, consider the following points:

    • A RetrievalEventActionHandler implementation works only with an an event of type GetContentEvent. If a handler written exclusively for GetContentEvent inadvertently has other events included in the subscribed event list for a subscription, a runtime exception will be thrown because the first event passed to the handler will be an ObjectChangeEvent.
    • You can configure an event action handler (through the Subscription object) to run synchronously or asynchronously.
    • If a synchronous event action handler fails, an exception will return to the client and the transaction will be rolled back.

      If an asynchronous event action handler fails, an exception 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.

    • An asynchronous event action handler can update a source object, but it must first fetch the persisted instance of the source object before updating it. Do not update the source object passed to the asynchronous handler.

      A synchronous event action handler cannot update a source object. It is not supported.

    • You can implement an event action handler as a Java or JavaScript component.

      You can check in a Java event action handler as a CodeModule object, or you can specify a Java event action handler in the classpath of the application server where the Content Engine is running.

      If a Java event handler is intended to work with both ObjectChangeEvent and GetContentEvent, it must implement both interfaces. For example:
      public class NewEventHandler implements EventActionHandler, RetrievalEventActionHandler.

      Because JavaScript is loosely typed, you do not specify the event type in the onEvent method signature.

      Therefore, you need only a single OnEvent method for a JavaScript event handler to work with both ObjectChangeEvent and GetContentEvent.

    See Also:
    EventAction, Subscription, Subscription Concepts, Creating an Event Action Handler, Action Handlers: Restrictions and Best Practices
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void onEvent(RetrievalEvent event, Id subscriptionId)
      Invoked when an operation on an object triggers a subscribed event.
    • Method Detail

      • onEvent

        void onEvent(RetrievalEvent event,
                   Id subscriptionId)
                     throws EngineRuntimeException
        Invoked when an operation on an object triggers a subscribed event. Implement this method with the actions to be taken when GetContentEvent is triggered.
        Parameters:
        event - An event of type RetrievalEvent. Of the RetrievalEvent subclasses, only GetContentEvent is subscribable. so only a GetContentEvent object can be passed to this method.
        subscriptionId - An Id value that represents the GUID of the subscription that defines the triggered event. You can use this value to retrieve the Subscription object with which this handler is associated.
        Throws:
        EngineRuntimeException

© Copyright IBM Corporation 2006, 2013. All rights reserved.