Event filter - Event filter - Alfresco - Alfresco Events SDK for Out-of-Process Events - Alfresco/Alfresco-Events-SDK-for-Out-of-Process-Events/7.3/Alfresco-Events-SDK-for-Out-of-Process-Events/Install/Java-Event-API/Event-handling-library/Event-filter - 7.3 - 7.3

Alfresco Events SDK for Out-of-Process Events

Platform
Alfresco
Product
Alfresco Events SDK for Out-of-Process Events
Release
7.3
License
ft:lastPublication
2026-03-16T12:36:20.000000
ft:locale
en-US

Event filters can be used in the Event handler implementations (see Event handler interface) to narrow down the conditions required to execute the business logic (i.e. the code) in response to a repository event being triggered.

The EventFilter is an interface that defines the contract that must be fulfilled by a repository event. It is basically a predicate interface that allows the developer to easily define conditions that an event must match for the code to be executed.

A number of filter implementations are offered out-of-the-box, covering the most common use cases:

  • AspectAddedFilter - checks if an event corresponds to a repository node that has had specified aspect added.
  • AspectRemovedFilter - checks if an event corresponds to a repository node that has had specified aspect removed.
  • AssocTypeFilter - checks if an event corresponds to a specific association type. This doesn’t distinguish if the event is representing a peer-peer or parent-child association.
  • ContentAddedFilter - checks if an event represents the addition of content (i.e. a file) to an existing cm:content node in the repository.
  • ContentChangedFilter - checks if an event represents a content update (i.e. file updated) of a cm:content node in the repository.
  • IsFileFilter - checks if an event corresponds to a repository node of type cm:content or subtype (i.e. a file).
  • IsFolderFilter - checks if an event corresponds to a repository node of type cm:folder or subtype (i.e. a folder).
  • MimeTypeFilter - checks if an event represents a content node (i.e. cm:content) with a specific MIME type.
  • NodeAspectFilter - checks if an event represents a node with a specific aspect.
  • NodeMovedFilter - checks if an event represents a node being moved in the repository.
  • NodeTypeChangedFilter - checks if an event represents the change of the type of a node in the repository.
  • NodeTypeFilter - checks if an event represents a node with a specific type.
  • PropertyAddedFilter - checks if an event corresponds to the addition of a node property in the repository.
  • PropertyChangedFilter - checks if an event corresponds to the update of a node property in the repository.
  • PropertyCurrentValueFilter - checks if an event represents a node with a specific property with a specific current value.
  • PropertyRemovedFilter - checks if an event corresponds to the removal of a specific property to a node in the repository.
  • PropertyPreviousValueFilter - checks if an event represents a node with a specific property with a specific previous value.
  • PropertyValueFilter - checks if an event represents a node with a specific property with a specific value.

You can use these filters alone or combine several of them into one complex filter.

For instance, you can create a complex filter to react to an event related to the modification of the title of content type cm:content with a MIME type of text/html:

public EventFilter getEventFilter(){
    return PropertyChangedFilter.of("cm:title") // If title changed
            .and(NodeTypeFilter.of("cm:content")) // And it's a file
            .and(MimeTypeFilter.of("text/html")); // And the file is a HTML file
}

It’s also possible to implement custom event filters (see Implementing custom event filters).