public void onSuccess(CpsThreadGroup g) {
// to exclude outer StepExecutions, first build a map by FlowHead
// younger threads with their StepExecutions will overshadow old threads, leaving inner-most threads alone.
Map<FlowHead,StepExecution> m = new HashMap<FlowHead, StepExecution>();
for (CpsThread t : g.threads.values()) {
StepExecution e = t.getStep();
if (e!=null)
m.put(t.head,e);
}
r.set(ImmutableList.copyOf(m.values()));