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
-
Optional Element Summary
Modifier and TypeOptional ElementDescription
Optional parameter: A short description for the service.boolean
Optional 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 name
Optional 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 description
Optional 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 source
Optional parameter: the name of the entity to subscribe to for events. If blank or omitted, then the current entity is assumed.- Default:
""
-
eventName
String eventName
Required parameter: the name of the event to subscribe to. Event names are case sensitive. -
sourceProperty
String sourceProperty
Optional 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 enabled
Optional 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 handler
Required 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.
-