InvoiceCreationOutput creationOutput = (InvoiceCreationOutput)getOutput();
try {
createInvoice();
if (input.isRenderingEnabled() &&
!input.getInvoiceOutputFormat().equals(OutputFormat.XML)) {
InvoiceRenderingOutput renderingOutput = renderInvoice();
if (!renderingOutput.isErroneous()) {
URI outputURI = renderingOutput.getInvoiceOutputURI();
if (outputURI != null) {
creationOutput.setInvoiceOutputURI(outputURI);
}
} else {
setOutput(renderingOutput);