How to know if a replication is success or not in a workflow process step ? | Community
Skip to main content
Level 3
June 18, 2017
Solved

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

  • June 18, 2017
  • 3 replies
  • 2822 views

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.
Best answer by Rajeev_Kumar

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

Rajeev_Kumar
Rajeev_KumarAccepted solution
Level 3
June 19, 2017

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.

MC_Stuff
Level 10
June 19, 2017

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,

Level 3
June 19, 2017

Thanks for the response..it worked.