ThingWorx Edge Java SDK > Application Details > VirtualThing Component > Defining Events > Triggering an Event
Triggering an Event
Triggering an event that the ThingWorx platform will receive (if subscribed) is straightforward.
Just triggering an event is not enough to send it to the ThingWorx platform. To send an event, you must call the updateSubscribedEvents method of the VirtualThing class. This call sends all events that have been queued to the platform.
Here is an example:
ValueCollection eventInfo = new ValueCollection();
eventInfo.put(“ErrorMessage”, new StringPrimitive(“There was an error…”));
super.queueEvent(“ErrorEvent”, DateTime.Now(), eventInfo);