ThingWorx Edge Java SDK > Application Details > VirtualThing Component > Defining Events > Using Annotations to Define Events
  
Using Annotations to Define Events
The @ThingWorxEventDefinitions annotation contains all the child @ThingWorxEventDefinition annotations. Annotations are placed at the beginning of the main code file, after the import statements.
Here is an example of defining events from the SteamSensor.java example:
@ThingworxEventDefinitions(events = {
@ThingworxEventDefinition(name="SteamSensorFault",description="Steam sensor fault",
dataShape="SteamSensor.Fault", category="Faults", isInvocable=true,
isPropertyEvent=false)