Writing a Property
When connected to the ThingWorx Platform, an application can also write a value to a property of a Remote Thing. In the following example, the property CurrentLocation is updated with new location data. The update is done without a bind to a VirtualThing. A bind request issued to the ThingWorx Platform is required for offline support and caching of the data.
//
// Writing a property
///////////////////////////////////////////////////////////////
LocationPrimitive location = new LocationPrimitive(42.36, -71.06, 10.0);
// This code sets the CurrentLocation property of the Thing to the GPS
// coordinates of Boston, Massachusetts, USA.
client.writeProperty(ThingworxEntityTypes.Things, ThingName, "CurrentLocation",
location, 5000);
LOG.info("Wrote to the property 'CurrentLocation' of Thing {}. value: {}",
ThingName, location.toString());