@Override
    public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext)
    {
        return ConfigurationBuilder
        .begin()
        .addRule()
        .when(Query.fromType(ReportModel.class).withProperty(ReportModel.TEMPLATE_TYPE, TemplateType.FREEMARKER.toString()))
        .perform(new FreeMarkerThreadedRenderer(furnace))

        .addRule()
        .when(Query.fromType(ReportResourceFileModel.class))
        .perform(new AbstractIterationOperation<ReportResourceFileModel>() {
            @Override
            public void perform(GraphRewrite event, EvaluationContext context, ReportResourceFileModel payload) {
                ReportService reportService = new ReportService(event.getGraphContext());
                Path outputDir = reportService.getReportDirectory();

                File directory = outputDir.toFile();
                File fullPath = new File(directory, FilenameUtils.separatorsToSystem("resources/" + payload.getPrettyPath()));

                try {
                    FileUtils.forceMkdir(fullPath.getParentFile());
                    FileUtils.copyFile(payload.asFile(), fullPath);
                    LOG.info("Copied raw file: " + payload.getFilePath() + " to: " + fullPath.getAbsolutePath());
                } catch (IOException e) {
                    LOG.warning("IOException creating file: " + fullPath.getAbsolutePath() + ", due to: " + e.getMessage());
                }
            }
        });
    }
@ Override public Configuration getConfiguration ( RuleLoaderContext ruleLoaderContext ) { return ConfigurationBuilder . begin ( ) . addRule ( ) . when ( Query . fromType ( ReportModel . class ) . withProperty ( ReportModel . TEMPLATE_TYPE , TemplateType . FREEMARKER . toString ( ) ) ) . perform ( new FreeMarkerThreadedRenderer ( furnace ) ) . addRule ( ) . when ( Query . fromType ( ReportResourceFileModel . class ) ) . perform ( new AbstractIterationOperation < ReportResourceFileModel > ( ) { @ Override public void perform ( GraphRewrite event , EvaluationContext context , ReportResourceFileModel payload ) { ReportService reportService = new ReportService ( event . getGraphContext ( ) ) ; Path outputDir = reportService . getReportDirectory ( ) ; File directory = outputDir . toFile ( ) ; File fullPath = new File ( directory , FilenameUtils . separatorsToSystem ( "resources/" + payload . getPrettyPath ( ) ) ) ; try { FileUtils . forceMkdir ( fullPath . getParentFile ( ) ) ; FileUtils . copyFile ( payload . asFile ( ) , fullPath ) ; LOG . info ( "Copied raw file: " + payload . getFilePath ( ) + " to: " + fullPath . getAbsolutePath ( ) ) ; } catch ( IOException e ) { LOG . warning ( "IOException creating file: " + fullPath . getAbsolutePath ( ) + ", due to: " + e . getMessage ( ) ) ; } } } ) ; }
@formatter:off