// FunctionInvoker
@Override
public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
final HistoricalViewEvaluationResult evaluationResult = (HistoricalViewEvaluationResult) inputs.getValue(ValueRequirementNames.HISTORICAL_TIME_SERIES);
final Set<ComputedValue> results = Sets.newHashSetWithExpectedSize(desiredValues.size());
final ComputationTargetSpecification targetSpec = target.toSpecification();
for (final ValueRequirement desiredValue : desiredValues) {
final ValueRequirement requirement = getNestedRequirement(executionContext.getComputationTargetResolver(), target, desiredValue.getConstraints());
if (requirement != null) {
@SuppressWarnings("rawtypes")
final TimeSeries ts = evaluationResult.getTimeSeries(requirement);
if (ts != null) {
results.add(new ComputedValue(new ValueSpecification(desiredValue.getValueName(), targetSpec, desiredValue.getConstraints()), ts));
} else {
s_logger.warn("Nested requirement {} did not produce a time series for {}", requirement, desiredValue);
}