The planning of an autonomous mission for UAVs requires more than the description of the points to be visited along the trajectory by which a certain task must be performed. However, the way in which such missions are planned does not provide conditions for the aircraft or the ground control system to find alternative ways of carrying out the mission, in the event of a risk or other situation different from what was initially planned. In this sense, this paper makes use of a complementary description of the trajectory of a UAV, specifying it through the Discrete Events Systems (DES) framework. Furthermore, it makes use of sensor information to identify situations of risk and, from this, to systematically carry out changes in the mission initially programmed in the aircraft in order to avoid undesired situations.