public static void aggregate(String portfolioName, String aggregationName,
PortfolioMaster portfolioMaster, PositionMaster positionMaster,
PositionSource positionSource, SecuritySource secSource,
AggregationFunction<?>[] aggregationFunctions, boolean split) {
PortfolioSearchRequest searchReq = new PortfolioSearchRequest();
searchReq.setName(portfolioName);
s_logger.info("Searching for portfolio " + portfolioName + "...");
PortfolioSearchResult searchResult = portfolioMaster.search(searchReq);
s_logger.info("Done. Got " + searchResult.getDocuments().size() + " results");
ManageablePortfolio manageablePortfolio = searchResult.getFirstPortfolio();
if (manageablePortfolio == null) {