RM-1981 (Cant reject the record that has any version records)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@98191 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2015-02-26 21:13:55 +00:00
parent f212d67b58
commit db1ec1fae2

View File

@@ -168,13 +168,22 @@ public class RecordAspect extends AbstractDisposableItem
kind = BehaviourKind.CLASS,
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
)
public void onRemoveReference(NodeRef fromNodeRef, NodeRef toNodeRef, QName reference)
public void onRemoveReference(final NodeRef fromNodeRef, NodeRef toNodeRef, QName reference)
{
// Deal with versioned records
if (reference.equals(CUSTOM_REF_VERSIONS))
{
// Apply the versioned aspect to the from node
nodeService.removeAspect(fromNodeRef, ASPECT_VERSIONED_RECORD);
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
@Override
public Void doWork()
{
// Apply the versioned aspect to the from node
nodeService.removeAspect(fromNodeRef, ASPECT_VERSIONED_RECORD);
return null;
}
});
}
// Execute script if for the reference event