The basic version only requires a few parts:
- A proxy item specific to this use - String type
- A rule which triggers when the proxy item value changes
- A component in a widget that sends a command to the proxy item
The magic is really only in the command that gets sent to the proxy item by the widget. You want the proxy items state to convey the information about which item’s metadata is being updated and what that update is. You can do something as simple as put a comma between those two pieces of info (e.g., “itemName,newMetadataValue”).
Now when the proxy item gets that command, its state should change and that triggers the rule. The rule can get the proxy item state and split that state on the comma so that array[0] is item to update and array[1] is data and the rule can then easily update the metadata by your prefered method.
For completeness, I then usually have the rule reset the proxy item to some default value.
You can see a system that is only one step more complicated than this in my scene widget and the associated rule. In that case there’s a third piece of information passed on in the proxy item state and that is just the update procedure to be performed (e.g., Add, Delete, etc.).