WriteOperation operation = startWriteOperation();
try {
// check if the activity has any references in the workspaces
NodeId nodeId = activity.getId();
if (stateMgr.hasNodeReferences(nodeId)) {
NodeReferences refs = stateMgr.getNodeReferences(nodeId);
if (refs.hasReferences()) {
throw new ReferentialIntegrityException("Unable to delete activity. still referenced.");
}
}
// TODO:
// check if the activity is used in anywhere in the version storage