Skip navigation links
Thingworx Platform API
8.5.0
com.thingworx.metadata.annotations

Annotation Type ThingworxSubscription



  • @Target(value=ANNOTATION_TYPE)
     @Retention(value=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:
    Subscription
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element and Description
      java.lang.String eventName


      Required parameter: the name of the event to subscribe to.
      java.lang.String handler


      Required parameter: the name of the service that should be invoked whenever the subscription receives an event.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      java.lang.String description


      Optional parameter: A short description for the service.
      boolean enabled


      Optional parameter: whether the subscription should listen for events.
      java.lang.String name


      Optional parameter: The name of the Subscription.
      java.lang.String source


      Optional parameter: the name of the entity to subscribe to for events.
      java.lang.String sourceProperty


      Optional parameter: the name of the property that this subscription should monitor.
    • Element Detail

      • eventName

        public abstract java.lang.String eventName


        Required parameter: the name of the event to subscribe to. Event names are case sensitive.
      • handler

        public abstract java.lang.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.
      • name

        public abstract java.lang.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

        public abstract java.lang.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

        public abstract java.lang.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:
        ""
      • sourceProperty

        public abstract java.lang.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

        public abstract 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