Document authoringDocument = getPublication().getAreaVersion(liveDocument, Publication.AUTHORING_AREA);
OK = OK && canWorkflowFire(authoringDocument);
SiteTree tree = getPublication().getTree(liveDocument.getArea());
SiteTreeNode node = tree.getNode(liveDocument.getId());
if (node == null) {
throw new ExecutionException(
"Sitetree node for document [" + liveDocument + "] does not exist!");
}
Label label = node.getLabel(liveDocument.getLanguage());
if (label == null) {
throw new ExecutionException(
"Sitetree label for document [" + liveDocument + "] does not exist!");
}
if (node.getLabels().length == 1 && node.getChildren().length > 0) {
if (log.isDebugEnabled()) {
log.debug(
"Cannot delete last language version of document ["
+ liveDocument
+ "] because this node has children.");