Expand my Community achievements bar.

Day 15 - Eventing In AEM | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

Day 15 - Eventing In AEM by Red Quark

Abstract

Howdy fellow devs ! Capturing events in a very common use case in any software system and AEM is no exception. There are many use cases where we need to perform some operation when something specific happens in AEM.

There are various ways by which event handling can be done in AEM -
1. Event Listener - JCR level events with the observation (discussed in this post)
2. Event Handler - Sling level events (discussed in this post)
3. Workflow and Launchers (discussed in previous three posts)
4. Schedulers with cron expressions (will be discussed in the next post)

Event Handlers
We can create an Event Handler by following below steps -
1. Write a service class that implements the EventHandler interface.
2. Register the service with property EventConstants.EVENT_TOPIC.
3. Implement the handleEvent(Event event) method to trigger the job.

Example
Let us create a custom event handler that will be triggered when a page is activated and executes a workflow on the path for which the replication is triggered. The main thing to see here is how we capture the event. Execution of the workflow has the same logic we discussed in the last post discussing trigger workflow programmatically.

Read Full Blog

Day 15 - Eventing In AEM

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies