AI rules- quick questiom

Quick question, if an AI unit has been charged by an enemy unit and therefore in its next activation, the AI unit still in base to base contact, does it always attack the enemy unit? Or does it still have to roll to see what action does it perform? Thank you!