Unexpected Multiple Invocations of PackageContentBuilder.create() on Deactivate Replication
I am encountering an unexpected behavior in AEM during the Page Publish workflow rollback scenario.
When a parent page is activated (using Replicator.replicate) using a custom replication agent, the replication framework correctly triggers one invocation of PackageContentBuilder.create(which is an implementation of ContentBuilder class, and is configured through serializationType in the agent) for the parent payload.
However, when the same parent page is deactivated (as part of rollback), the replication framework triggers multiple implicit invocations of PackageContentBuilder.create() — first for the parent, then for each of its child pages.
This occurs even though only the parent path is explicitly passed to the Replicator.replicate() call.
Raised adobe ticket and they confirmed that this is the OOTB functionality and we want to implement a custom replication deactivation flow. Can anyone please suggest how to implement that.