String destUrl = builder.buildCanonicalUrl(publication, getSecarea(), destDocumentid, language);
Document document;
Document newdocument;
WorkflowFactory factory = WorkflowFactory.newInstance();
log("init workflow history");
try {
document = builder.buildDocument(publication, srcUrl);
newdocument = builder.buildDocument(publication, destUrl);
} catch (DocumentBuildException e) {
throw new BuildException(e);
}
try {
if (factory.hasWorkflow(document)) {
String[] roles = new String[0];
Situation situation =
WorkflowFactory.newInstance().buildSituation(roles, getUserId(), getMachineIp());
WorkflowFactory.initHistory(document, newdocument, situation);
}