try {
final FinancialSecurity security = (FinancialSecurity) target.getTrade().getSecurity();
final ConfigSource configSource = OpenGammaCompilationContext.getConfigSource(context);
final SecuritySource securitySource = OpenGammaCompilationContext.getSecuritySource(context);
final ConfigDBInstrumentExposuresProvider exposureSource = new ConfigDBInstrumentExposuresProvider(configSource, securitySource);
final ConfigDBCurveConstructionConfigurationSource constructionConfigurationSource = new ConfigDBCurveConstructionConfigurationSource(configSource);
final Set<ValueRequirement> requirements = new HashSet<>();
final ValueProperties.Builder commonCurveProperties = getCurveProperties(target, constraints);
for (final String curveExposureConfig : curveExposureConfigs) {
final Set<String> curveConstructionConfigurationNames = exposureSource.getCurveConstructionConfigurationsForConfig(curveExposureConfig, security);
for (final String curveConstructionConfigurationName : curveConstructionConfigurationNames) {
final ValueProperties properties = commonCurveProperties.get().copy().with(CURVE_CONSTRUCTION_CONFIG, curveConstructionConfigurationName).get();
requirements.add(new ValueRequirement(CURVE_BUNDLE, ComputationTargetSpecification.NULL, properties));
requirements.add(new ValueRequirement(JACOBIAN_BUNDLE, ComputationTargetSpecification.NULL, properties));
final CurveConstructionConfiguration curveConstructionConfiguration = constructionConfigurationSource.getCurveConstructionConfiguration(curveConstructionConfigurationName);
final String[] curveNames = CurveUtils.getCurveNamesForConstructionConfiguration(curveConstructionConfiguration);
for (final String curveName : curveNames) {
final ValueProperties curveProperties = ValueProperties.builder()
.with(CURVE, curveName)
.get();