Detecting property changes on an entity instance

From your rule set code, you can use the entity instance read-only property Changed to check if the entity changed at all. This property returns a Boolean value of true if the entity instance has one or more properties that changed.

if (myAddress.Changed) {
  // Your code here...
}

From your rule set code, you can get the set of changed properties on an entity instance using the ChangedFields property. That property value has the type java.util.Set.

The following example uses a Gosu block that iterates across the set of changed properties:

if (myAddress.Changed) {
  myAddress.ChangedFields.each( \ e -> print("Address has changed property: " + e))
}

See also