Hello Team,
I am using Alfresco Content Service Community 7.2.
I am checking out my node using java script api as below.
node.addAspect("cm:workingcopy");
node.properties["cm:workingCopyMode"] = "Check Out";
node.properties["cm:workingCopyLabel"] = label;
node.properties["cm:workingCopyOwner"] = user;
I wanted to cancel my Checked Out node so I am cancelling using below code
if (node.isLocked)
node.removeAspect("cm:lockable");
if (node.hasAspect("cm:workingcopy"))
node.removeAspect("cm:workingcopy");
node.Save();And getting error
java.lang.UnsupportedOperationException: Use CheckOutCheckInservice to manipulate working copies.
So I changed my code to
if (node.isLocked)
node.removeAspect("cm:lockable");
if (node.hasAspect("cm:workingcopy"))
node.cancelCheckout();
node.Save();And now I am getting below error.
CheckOutCheckInServiceException: 03131029 The original node cannot be found. Perhaps the copy has been corrupted or the original has been deleted or moved.
Do anyone have idea how to solve this issue?