Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to know if a replication is success or not in a workflow process step ?

Avatar

Level 3

Hi ,

My requirement is to replicate a page/asset from a workflow using a different replication agent.
I am using replicator.replicate(session,ReplicationActionType.ACTIVATE, path, opts);

I wanted to know if the replication is success or not in the code itself(either by reponse status=200 or some Boolean value) , as I wanted to follow some steps if the replication is success(Activate).

Is there any way to know ,please reply?

Thanks,

Pallavi

1 Accepted Solution

Avatar

Correct answer by
Level 3

com.day.cq.replication.Replicator has a method 'getReplicationStatus' whic returns the object of 'ReplicationStatus' and it has methods like 'isActivated', 'isDeactivated' 'isDelivered' etc to check if content is replicated or not.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 3

com.day.cq.replication.Replicator has a method 'getReplicationStatus' whic returns the object of 'ReplicationStatus' and it has methods like 'isActivated', 'isDeactivated' 'isDelivered' etc to check if content is replicated or not.

Avatar

Level 9

Hi Pallavi,

You can adopt payload resource to replicationStatus. http://dev.day.com/docs/en/cq/5-5/javadoc/com/day/cq/replication/ReplicationStatus.html

Ex:- ReplicationStatus rs = res.adaptTo(ReplicationStatus.class);

Thanks,

Avatar

Level 3

Thanks for the response..it worked.