Package org.nuclos.api.rule
Interface PrintFinalRule
@RuleType(name="nuclos.ruletype.printfinalrule.name",
description="nuclos.ruletype.printfinalrule.description")
public interface PrintFinalRule
PrintFinalRule
is the interface that should be used to make an rule
applicable for PrintFinal-Events.
Classes implementing this interface can be attached to the printout process.
{\@code package de.mynuclet; import org.nuclos.api.rule.PrintFinalRule; import org.nuclos.api.context.PrintFinalContext; import org.nuclos.api.annotation.Rule; import org.nuclos.api.exception.BusinessException; import org.nuclos.api.context.PrintResult; import org.nuclos.api.provider.BusinessObjectProvider; \@Rule(name="PrintFinalRuleBeispiel", description="PrintFinalRuleBeispiel") public class PrintFinalRuleBeispiel implements PrintFinalRule { public void printFinal(PrintFinalContext context) throws BusinessException { final Auftrag auftrag = context.getBusinessObject(Auftrag.class); for (final PrintResult result : context.getPrintResults()) { Auftragsdokument auftragsdokument = new Auftragsdokument(); auftragsdokument.setDatei(result.getOutput()); auftragsdokument.setDatum(new java.util.Date()); context.log("insert Auftragsdokument " + result.getOutput().getName()); auftrag.insertAuftragsdokument(auftragsdokument); } BusinessObjectProvider.update(auftrag); } } }
- Author:
- Moritz Neuhaeuser
-
Method Summary
Modifier and TypeMethodDescriptionvoid
printFinal
(PrintFinalContext context) PrintContext
is the context providing all print - relevant attributes and methods.
-
Method Details
-
printFinal
PrintContext
is the context providing all print - relevant attributes and methods.- Parameters:
context
-PrintContext
context- Throws:
BusinessException
-