fix HQL query for counting active textflows in iteration