* initializes {@link #workflowDocument} so that info can be displayed on the work inquiry section table
* <p>This is because during the inquiry, the work bo is fetched via ojb directly and not via the document service</p>
*/
@Override
public DocumentHeader getDocumentHeader() {
DocumentHeader tmpDocumentHeader = super.getDocumentHeader();
if (tmpDocumentHeader != null && ! tmpDocumentHeader.hasWorkflowDocument()) {
WorkflowDocument wfd = null;
if (! StringUtils.isEmpty(getDocumentNumber())) {
wfd = WorkflowDocumentFactory.loadDocument(
GlobalVariables.getUserSession().getPrincipalId(), getDocumentNumber());
}
if (wfd == null) {
log.debug("set dummy WorkflowDocument");
tmpDocumentHeader.setWorkflowDocument(new DummyWorkFlowDocument());
} else {
tmpDocumentHeader.setWorkflowDocument(wfd);
log.debug("set found WorkflowDocument");
}
}
return tmpDocumentHeader;
}