Triggering Events
While connected to the ThingWorx Platform, you can trigger an event on a Remote Thing. The code snippet below shows how to use a ValueCollection to specify the payload of an event, and then trigger a FileEvent on a Remote Thing.
//
// Triggering an event
/////////////////////////////////////////////////////////////

// A ValueCollection is used to specify the payload of
// an event.
ValueCollection payload = new ValueCollection();

payload.put("name", new StringPrimitive("FileName"));
payload.put("path", new StringPrimitive("/file.txt"));
payload.put("fileType", new StringPrimitive("F"));
payload.put("lastModifiedDate", new DatetimePrimitive());
payload.put("size", new NumberPrimitive(256));

// This will trigger the 'FileEvent' of a Remote Thing
// on the platform.
cient.fireEvent(ThingworxEntityTypes.Things, ThingName,
"FileEvent", payload, 5000);
You have probably noticed the use of primitives in the Steam Sensor example. It is important to keep in mind that the ThingWorx environment has its own set of primitives for working with data. The primitives are used when populating an INFOTABLE or a ValueCollection, for example. The ThingWorx primitives map to and extend basic Java types. ThingWorx primitives include LOCATION, THINGNAME, IMAGE, and more. For a complete list of the ThingWorx base types/primitives, refer to Base Types and Primitives.
* 
The Java SDK does not support an offline message store. While you could use the property cache as an offline message store, it is NOT recommended because your application will crash once the heap becomes filled. How quickly the heap fills depends on the volume of data you are storing.
Was this helpful?