chore(engine): check if already queryed by historic case instance state

related to #CAM-2839