The Flink API supports stateful mapper functions and so should the HTM DSL.
An important scenario is to store predictions over time for comparison purposes with later events, to calculate an error rate (for example). See the HotGym example.
The workaround at this time is to use a trivial select function followed by mapWithState.