Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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,