if (eventName == null) {
log.debug("No workflow event.");
} else {
log.debug("Workflow event: [" + eventName + "]");
// check for workflow instance first (task can initialize the workflow history)
WorkflowFactory factory = WorkflowFactory.newInstance();
try {
document = publication.getDocumentBuilder().buildDocument(publication, webappUrl);
} catch (DocumentBuildException e) {
throw new ExecutionException(e);
}
doTransition = factory.hasWorkflow(document);
}
}