Bulk activation complete event handler
Experience Manager Guides exposes com/adobe/fmdita/replication/complete event that is used to perform any operations after the completion of a bulk activation process. This event is triggered whenever a bulk activation process is completed. For example, if you run the bulk activation of an AEM site preset of a map, this event is called after the activation process ends.
You need to create an AEM event handler to read the properties available in this event and do further processing.
Event details are explained below:
Event name:
com/adobe/fmdita/replication/complete
Parameters:
Name
Type
Description
pathString
The path of the file that triggered this event.
For example,
It is a list of paths serialized as a JSON array.
For example,
/content/output/sites/ditamap1-ditamap.It is a list of paths serialized as a JSON array.
messageTypeString
The type of a message.
Possible option :
Possible option :
REPLICATIONactionString
This is the action performed.
Possible option :
Possible option :
BulkReplicateuserString
The user who started the operation.
resultString
The result of the Bulk Activation. It is a serialized JSON Object:
{"success":boolean,"code":integer,"message":"" }agentIdString
The agentId used in the replication. For example,
"publish".importModeString
Import mode used in Activation. The possible options are:
REPLACE, MERGE, UPDATE.Sample Event Listener:
@Component(service = EventHandler.class,
immediate = true,
property = {
EventConstants.EVENT_TOPIC + "=" + "com/adobe/fmdita/replication/complete",
})
public class SampleEventHandler implements EventHandler {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
@Override
public void handleEvent(final Event event) {
Map<String, String> properties = new HashMap<>();
properties.put("paths", (String) event.getProperty("paths"));
properties.put("messageType", (String) event.getProperty("messageType"));
properties.put("action", (String) event.getProperty("action"));
properties.put("result", (String) event.getProperty("result"));
properties.put("user", (String) event.getProperty("user"));
properties.put("agentId", (String) event.getProperty("agentId"));
properties.put("importMode", (String) event.getProperty("importMode"));
String eventTopic = event.getTopic();
log.debug("eventTopic {}", eventTopic);
for(Map.Entry entry:properties.entrySet()) {
log.debug(entry.getKey() + " : " + entry.getValue());
}
}
}
recommendation-more-help
11125c99-e1a1-4369-b5d7-fb3098b9b178