ThingWorx Edge Java SDK > Working with Things
Working with Things
A Remote Thing on the ThingWorx Platform and a Virtual Thing on a remote asset are related to each other by the name assigned to them. A Virtual Thing collects and stores the values of its properties. It can then forward these values to its corresponding Remote Thing on the ThingWorx Platform.
To implement a Virtual Thing in your application, extend the VirtualThing class. The following code would go in a new file, for example, SimpleThing.java:

public class SimpleThing extends VirtualThing {

public SimpleThing(String name, String description, ConnectedThingClient client) {
super(name, description, client);
}
}
Once you have constructed a VirtualThing, you can bind it to a client. For example:
//
// Create a VirtualThing and bind it to the client
///////////////////////////////////////////////////////////////

// Create a new VirtualThing. The name parameter should match the
// name of a Remote Thing on the ThingWorx Platform.
SimpleThing thing = new SimpleThing("SimpleThing_1", "A basic Virtual Thing", client);

// Bind the VirtualThing to the client. This bind method tells the
// platform that the Remote Thing 'SimpleThing_1' is now connected and that
// it is ready to receive requests.
client.bindThing(thing);
As long as you have created a corresponding Remote Thing called SimpleThing_1 on the ThingWorx Platform, its isConnected property will be set to true and its lastConnection property updated to the current time when you run the application.
You can verify that it is connected by requesting the current value of the isConnected property, using the REST API of the ThingWorx Platform. Using a REST client such as Postman, set the HTTP method GET and supply the following URL, substituting the domain name of your ThingWorx Platform and its port instead of PLATFORM_HOST and PLATFORM_PORT:

https://PLATFORM_HOST]:[PLATFORM_PORT]/Thingworx/Things/SimpleThing_1/Properties/isConnected
Set the Accept[ header to application/json, and run the call to check whether the value of isConnected is true.
Was this helpful?