if (suppressExecutionOnNoMarketData && allRequiredMarketData.size() > 0 && marketDataValues.size() == 0) {
// Market data was expected but the snapshot was empty. Don't bother doing anything else, and indicate that
// execution should not continue.
return false;
}
final ResultModelDefinition resultModel = getViewDefinition().getResultModelDefinition();
for (CompiledViewCalculationConfiguration calcConfig : getCompiledViewDefinition().getCompiledCalculationConfigurations()) {
final OverrideOperation operation = getCacheMarketDataOperation(getViewDefinition().getCalculationConfiguration(calcConfig.getName()));
final ViewComputationCache cache = getComputationCache(calcConfig.getName());
final Collection<ValueSpecification> marketDataRequirements = calcConfig.getMarketDataRequirements();
final Set<ValueSpecification> terminalOutputs = calcConfig.getTerminalOutputSpecifications().keySet();
final Collection<ComputedValueResult> valuesToLoad = new ArrayList<>(marketDataRequirements.size());
for (ValueSpecification marketDataSpec : marketDataRequirements) {
Object marketDataValue = marketDataValues.get(marketDataSpec);
ComputedValueResult computedValueResult;
if (operation != null) {
if (marketDataValue != null) {
marketDataValue = operation.apply(marketDataSpec.toRequirementSpecification(), marketDataValue);
if (marketDataValue == null) {
s_logger.debug("Market data {} discarded by override operation", marketDataSpec);
}
}
}
if (marketDataValue == null) {
s_logger.debug("Unable to load market data value for {} from snapshot {}", marketDataSpec, getValuationTime());
missingMarketData++;
// TODO provide elevated logs if requested from market data providers
computedValueResult = new ComputedValueResult(marketDataSpec, MissingInput.MISSING_MARKET_DATA, MARKET_DATA_LOG);
} else {
computedValueResult = new ComputedValueResult(marketDataSpec, marketDataValue, AggregatedExecutionLog.EMPTY);
fragmentResultModel.addMarketData(computedValueResult);
fullResultModel.addMarketData(computedValueResult);
}
if (terminalOutputs.contains(marketDataSpec) && (resultModel.getOutputMode(marketDataSpec.getTargetSpecification().getType()) != ResultOutputMode.NONE)) {
fragmentResultModel.addValue(calcConfig.getName(), computedValueResult);
fullResultModel.addValue(calcConfig.getName(), computedValueResult);
}
valuesToLoad.add(computedValueResult);
}