// otherwise process the report one time to walk through all eligible states. Record all subreports,
// and then compute the runlevels based on what we have in the caches.
this.structuralPreprocessingNeeded = true;
}
final DataSchemaDefinition definition = report.getDataSchemaDefinition();
final DefaultFlowController flowController = new DefaultFlowController(processingContext,
definition, StateUtilities.computeParameterValueSet(report, parameterValues),
report.getParameterDefinition().getParameterDefinitions(), structuralPreprocessingNeeded);
final Object dataCacheEnabledRaw =
report.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.DATA_CACHE);
final boolean dataCacheEnabled = Boolean.FALSE.equals(dataCacheEnabledRaw) == false;
final CachingDataFactory dataFactory = new CachingDataFactory(report.getDataFactory(), dataCacheEnabled);
dataFactory.initialize(processingContext.getConfiguration(), processingContext.getResourceManager(),
processingContext.getContentBase(), processingContext.getResourceBundleFactory());
dataFactory.open();
final FunctionStorageKey functionStorageKey = FunctionStorageKey.createKey(null, report);
this.dataFactoryManager.store(functionStorageKey, dataFactory);
// eval query, query-limit and query-timeout
this.flowController = flowController;
final Integer queryLimitDefault = IntegerCache.getInteger(report.getQueryLimit());
final Integer queryTimeoutDefault = IntegerCache.getInteger(report.getQueryTimeout());
final Object queryRaw = evaluateExpression(report.getAttributeExpression(AttributeNames.Internal.NAMESPACE,
AttributeNames.Internal.QUERY), report.getQuery());
final Object queryLimitRaw = evaluateExpression(report.getAttributeExpression(AttributeNames.Internal.NAMESPACE,
AttributeNames.Internal.QUERY_LIMIT), queryLimitDefault);
final Object queryTimeoutRaw = evaluateExpression(report.getAttributeExpression(AttributeNames.Internal.NAMESPACE,
AttributeNames.Internal.QUERY_TIMEOUT), queryTimeoutDefault);
this.query = (String) ConverterRegistry.convert(queryRaw, String.class, report.getQuery());
this.queryLimit = (Integer) ConverterRegistry.convert(queryLimitRaw, Integer.class, queryLimitDefault);
this.queryTimeout = (Integer) ConverterRegistry.convert(queryTimeoutRaw, Integer.class, queryTimeoutDefault);
DefaultFlowController postQueryFlowController = flowController.performQuery
(dataFactory, query, queryLimit.intValue(), queryTimeout.intValue(),
processingContext.getResourceBundleFactory());
final ReportPreProcessor[] processors = getAllPreProcessors(report);
MasterReport fullReport = report;
DataSchemaDefinition fullDefinition = definition;
for (int i = 0; i < processors.length; i++)
{
final ReportPreProcessor processor = processors[i];
fullReport = processor.performPreProcessing(fullReport, postQueryFlowController);
if (fullReport.getDataSchemaDefinition() != fullDefinition)