Annotation Interface ThingworxSubscription
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
@ThingworxExtensionApiAnnotation(since={6,6})
public @interface ThingworxSubscription
Defines a subscription that the entity wishes to handle. Subscriptions defined with this annotation can target standard events and
property events, and may also specify a source entity. The source entity should be another entity that is part of the platform, the
extension, or an entity in a dependent extension.
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionOptional parameter: A short description for the service.booleanOptional parameter: whether the subscription should listen for events.Optional parameter: The name of the Subscription.Optional parameter: the name of the entity to subscribe to for events.Optional parameter: the name of the property that this subscription should monitor.
-
Element Details
-
name
String nameOptional parameter: The name of the Subscription. For now, to maintain backwards compatibility with previous versions wherein Subscriptions did not contain names, this is not required. The name will be required in the future.- Default:
""
-
description
String descriptionOptional parameter: A short description for the service. The description should provide information on functionality of the Subscription and any other pertinent information for users.- Default:
""
-
source
String sourceOptional parameter: the name of the entity to subscribe to for events. If blank or omitted, then the current entity is assumed.- Default:
""
-
eventName
String eventNameRequired parameter: the name of the event to subscribe to. Event names are case sensitive. -
sourceProperty
String sourcePropertyOptional parameter: the name of the property that this subscription should monitor. This parameter is required when subscribing to property events. Property names are case sensitive.- Default:
""
-
enabled
boolean enabledOptional parameter: whether the subscription should listen for events. Note that if it is intended for subscriptions to listen for events immediately, then you must specify this parameter and assign to true.- Default:
false
-
handler
String handlerRequired parameter: the name of the service that should be invoked whenever the subscription receives an event. The service must belong to the entity defining the subscription.
-