Finding EventHandler for specific event.topic
Asked Answered
F

1

5

I'm discovering AEM workflows and the flow of the Request for Approval model. I've noticed (confirmed on AEM docs) that "if the user does not have the required privileges for publishing a specific page a workflow will be triggered to notify the appropriate person of your request to publish".

Trying to find how it's triggered I've found out ReplicationProcess that handles the activation action and sends a com/day/cq/wcm/workflow/req/for/activation event. Here is where I get lost - none of the AEM OSGi console known to me covers this relationship.

How can I find the event handler that is used for handling a specific event topic?

Fylfot answered 13/8, 2015 at 9:6 Comment(0)
B
7

If you know the event topic you can use bundleContext to find reference to proper EventHandler OSGi service, e.g. using AEM Groovy Console :

ServiceReference[] sr = bundleContext.getServiceReferences(org.osgi.service.event.EventHandler.class, "(event.topics=com/day/cq/wcm/workflow/req/for/activation)")

for (i=0; i< sr.length; i++) {
    println bundleContext.getService(sr[i])
}

Output

com.day.cq.wcm.workflow.impl.WcmWorkflowServiceImpl@618c5804

You can also use OSGi Felix Web Console (services tab) to find it:

web console service tab

Bilharziasis answered 13/8, 2015 at 9:9 Comment(1)
Thanks a lot. That's exactly what I was looking for!Lavinialavinie

© 2022 - 2024 — McMap. All rights reserved.