Mashup Builder > Mashups > Updating Properties Automatically in a Mashup
Updating Properties Automatically in a Mashup
A mashup using the GetProperties service can be configured to use websockets and receive updates to properties automatically. When the Automatically update values when able check box in the service properties panel is selected and the mashup is viewed by a user, the mashup run time creates a websocket connection with the Platform and subscribes to the properties that are bound to widgets. Whenever the properties change, the mashup will immediately receive the new value and process it as though the service had been invoked.
In order to create this websocket connection, ThingWorx generates a temporary application key (named TwxRuntimeKey_<Username>_appkey (in previous releases, it was named TwxRuntimeKey_Username) to bind with. The bind is needed in order to subscribe to the properties; otherwise, the Platform has no way of sending event data back to the browser. The temporary application key expires after 15 seconds and is then deleted after 30 seconds.
While this temporary key should get deleted after 30 seconds, if the Platform is shut down before 30 seconds elapses, this expired key may remain on the server. The next time that user views a websocket-enabled mashup, the old application key will get deleted and a new one will be generated.
If an Auto Refresh widget is bound to GetProperties and the browser supports websockets, the Auto-Refresh widget will not call GetProperties, but will still call any other services it is associated with. For more information on the Auto Refresh widget, see Auto Refresh Widget.