Using calculation results as targets

I would like to use the opengamma calculation engine to calculate some data , store that data, and then later use that data as a TARGET in a function . So for example if I could calculate individual cashflows for a position, store them as cashflows, and then calculate some function for each cashflow that I had created (say discounted_value, or value_divided_by_two). Are there any existing examples of this type of processing? perhaps it requires a custom targetResolver or source?

You particularly want to persist the data? You could store it in the time series database. If you’re not persisting it, you should be able to just require it as an input to the next function level up. If you look at any of the code that requires a YieldCurveDataBundle or similar, you’ll see how the output of one function can be the input of another.