In a guard clause   ',' is equivalent to 'and', so...

when MessageId =/= undefined, NewRegId =/= undefined ->