ThingWorx Edge Java SDK > Application Details > VirtualThing Component > Defining Events > Creating an Event Definition
Creating an Event Definition
To create an event definition, you can call the defineEvent method on the base VirtualThing. There are two defineEvent methods: one that takes an EventDefinition and one that takes the essential parameters for an EventDefinition:
defineEvent(EventDefinition eventDefinition)

defineEvent(String name, String description, String dataShape,
AspectCollection aspects)
The parameters for an event definition are:
name — The unique identifier for the event.
description — An explanation of the event.
dataShape — The name of the data shape that defines the event data.
aspects — The AspectCollection for the event definition.
For example:
"Event that sends an error",