How to know if a replication is success or not in a workflow process step ? | Community
Skip to main content
Level 3
Jun 18, 2017 7:09 PM UTC
Solved

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

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Rajeev_Kumar
Rajeev_KumarAccepted solution
Level 3
Jun 19, 2017 5:27 AM UTC

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.

3 replies

Level 3
Jun 19, 2017 10:57 AM UTC

Thanks for the response..it worked.

Translate
MC_Stuff
Level 10
Jun 19, 2017 6:10 AM UTC

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,

Translate
Rajeev_Kumar
Rajeev_KumarAccepted solution
Level 3
Jun 19, 2017 5:27 AM UTC

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.

Translate