Self-consistent modeling of runaway electron generation in massive gas injection scenarios in ASDEX Upgrade