Skip to content

Instantly share code, notes, and snippets.

@Vineeth-Mohan
Created June 11, 2012 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vineeth-Mohan/2911420 to your computer and use it in GitHub Desktop.
Save Vineeth-Mohan/2911420 to your computer and use it in GitHub Desktop.
String portfolio="Equity Portfolio View";
ViewDefinition equityDefenition = CustomBasicsComponentFactory._viewDefinitionRepository.getDefinition(portfolio);
ViewClient vc = CustomBasicsComponentFactory._viewProcessor.createViewClient(UserPrincipal.getLocalUser());
HistoricalMarketDataSpecification hd = new FixedHistoricalMarketDataSpecification(LocalDate.of(2010, 7, 7));
EnumSet<ViewExecutionFlags> flags=EnumSet.of(ViewExecutionFlags.RUN_AS_FAST_AS_POSSIBLE);
InstantProvider ip = Instant.now();
ViewCycleExecutionOptions vce=new ViewCycleExecutionOptions(ip,hd);
vce.setValuationTime(ip);
List<ViewCycleExecutionOptions> executions = new ArrayList<ViewCycleExecutionOptions>();
executions.add(vce);
ViewExecutionOptions executionOptions = ExecutionOptions.singleCycle(ip, hd, flags);
vc.setResultListener(new ResultListener("10"));
vc.attachToViewProcess(equityDefenition.getUniqueId(),executionOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment