If you wish to trigger actions based on provisioning/writing Types/metadata, you may do so by creating a type the mixes MetadataListener and implementing a tag-specific version of the notify() method. Please note that you will need to accept the same input parameter (
change) and return the same output parameter, of type
MetadataListenerNotifyResult, as is defined on the MetadataListener type (just as you would any callback method).
Note that the
notify() method is called immediately before the act of provisioning takes place. It contains a list of changed, new, and removed types; but those changes, additions, and removals have NOT been provisioned yet.
CAUTION: Be careful when implementing this, as logic in the notify method can significantly slow down provisioning if it is computationally expensive, and actions in the notify method can negatively impact (possibly break) the tag.