It is unclear what these Items are or where they come from. Do these Items have bindings or are they linked to Channels? If so then how do those bindings or channels work? That will give you the answer.
If these are Design Pattern: Unbound Item (aka Virtual Item) then you can initialize them when OH first comes up similar to Design Pattern: Encoding and Accessing Values in Rules (approach 2) or you can just check in your Rule and give it an initial value when the Rule triggers and the Item is NULL.
NOTE: Unrelated but in the future please How to use code fences
rule “Update Aussentemperatur”
when
Item AF_c received update
then
val c = if(AF_c.state == NULL) 0 else Math::abs((AF_c.state as Number).floatValue)
val m = if(AF_m.state == NULL) 0 else Math::abs((AF_m.state as Number).floatValue)
val a = if(AF_a.state == NULL) 0 else Math::abs((AF_m.state as Number).floatValue)
if ((Lock_i.state == ON) && (Lock_m.state == ON) && (Lock_a.state == ON)){
if(c - m > c - a) AF_a.postUpdate(c)
else AF_m.postUpdate(c)
}
end
Note that your Item names are basically meaningless out of context so I have no idea if it makes sense to initialize the values in this way.