How to write a listener? Please refer to the article below:
https://www.ptc.com/en/support/article/CS213788
In your case, you can listen to the pre-checkin listener. In the listener, when you receive a WTPart as the event target in the notifyVetoableEvent method implement your custom attribute comparison logic
Do not forget to check if the event type is WTPart, because the same event is also triggered for other objects during check-in.
if (eventTarget instanceof WTPart aPart) {
WTPart oldPart = (WTPart) WorkInProgressHelper.service.originalCopyOf(aPart);
// 1) Get attributes from the old version in a collection
// 2) Get attributes from the new version in a collection
// Compare both collections
if (!oldAttributes.equals(newAttributes)) {
throw new Exception("<Custom Error Message >");
}
}
Refer to the article below to get the attribute values:
https://www.ptc.com/en/support/article/CS135663
Hope this helps,
Thanks