com.filenet.api.engine

Interface EventActionHandler



  • public interface EventActionHandler
    An interface to be implemented as a 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. Note that for the GetContentEvent, the RetrievalEventActionHandler interface must be used.

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

    • 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(ObjectChangeEvent event, Id subscriptionId)
      Invoked when an operation on an object triggers a subscribed event, or when a publish or republish operation is configured to trigger an event action.
    • Method Detail

      • onEvent

        void onEvent(ObjectChangeEvent event,
                   Id subscriptionId)
                     throws EngineRuntimeException
        Invoked when an operation on an object triggers a subscribed event, or when a publish or republish operation is configured to trigger an event action. Implement this method with the actions to be taken when the event is triggered.
        Parameters:
        event - An event of type ObjectChangeEvent.
        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. For a publish or republish operation, the Id value is null.
        Throws:
        EngineRuntimeException

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