final SecureRandom random = new SecureRandom();
for (PositionDocument positionDocument : positions.values()) {
ManageablePosition position = positionDocument.getValue();
ManageableSecurityLink link = position.getSecurityLink();
SecuritySearchRequest ssr = new SecuritySearchRequest();
ssr.addExternalIds(link.getExternalIds());
SecuritySearchResult securitySearchResult = getToolContext().getSecurityMaster().search(ssr);
Security security = securitySearchResult.getFirstSecurity();
//Security security = position.getSecurity();
if (security != null && security instanceof CreditDefaultSwapOptionSecurity) {
CreditDefaultSwapOptionSecurity cdsOption = (CreditDefaultSwapOptionSecurity) security;