try {
String[] roles = new String[0];
Situation situation =
WorkflowFactory.newInstance().buildSituation(roles, getUserId(), getMachineIp());
DocumentType type =
DocumentTypeBuilder.buildDocumentType(getDocumentType(), getPublication());
WorkflowFactory.initHistory(document, type.getWorkflowFileName(), situation);
} catch (Exception e) {
throw new BuildException(e);
}
}