How to see that model change is due to Undo

So, when using Undo (ctrl9z) i can see that the transaction name obtained with e.object.name is actually the name of the transaction being undone. How can I detect that the changedEvent is caused by undo?

Thanks walter, I thought I get this value from the changedEvent object after transaction is finished

A ChangedEvent that is held in a Transaction was originally created due to some model or diagram change, not during an undo or redo.

That same ChangedEvent will be used, perhaps repeatedly, during undo or redo operations.

So I do not understand the problem that you have.

No problem walter, I just had the assumption that an undo would give a changedEvent that has the name “undo” (I actually saw it when debugging, held in some Zs property), not the name of the transaction that caused is being undone.
But what you are saying does make sense.