ThingworxMultiEventSubscription with Java using ExtensionSDK
Hello everybody,
has anyone exprience or can help to create a MultiEventSubscription using the ExtensionSDK?
So I am currently using Thingworx 9.6.1 with the ExtensionSDK 9.6.0. The latest available Eclipse Plugin i found is 9.0.1. When I use this combination to create an Extension and a ThingShape with an event and a subscription i get this result:
@ThingworxEventDefinitions(events = {
@ThingworxEventDefinition(name = "Message", description = "", category = "Message", dataShape = "TWX.Core.Message_DS", isInvocable = true, isPropertyEvent = false, isLocalOnly = false, aspects = {}) })
@ThingworxSubscriptions(subscriptions = {
@ThingworxSubscription(source = "", eventName = "Message", sourceProperty = "", handler = "OnMessage", enabled = true) })
public class ActorTS {
private static Logger _logger = LogUtilities.getInstance().getApplicationLogger(ActorTS.class);
public ActorTS() {
// TODO Auto-generated constructor stub
}
@ThingworxServiceDefinition(name = "OnMessage", description = "Subscription handler", category = "", isAllowOverride = false, aspects = {"isAsync:false" })
public void OnMessage(
@ThingworxServiceParameter(name = "eventData", description = "", baseType = "INFOTABLE") InfoTable eventData,
@ThingworxServiceParameter(name = "eventName", description = "", baseType = "STRING") String eventName,
@ThingworxServiceParameter(name = "eventTime", description = "", baseType = "DATETIME") DateTime eventTime,
@ThingworxServiceParameter(name = "source", description = "", baseType = "STRING") String source,
@ThingworxServiceParameter(name = "sourceProperty", description = "", baseType = "STRING") String sourceProperty) {
}
}
But I deeper look into the ExtensionSDK.shows, that there are special annotations for @ThingworxMultiEventSubscription:
@Target({ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@ThingworxExtensionApiAnnotation(since = {9, 5, 1})
public @interface ThingworxMultiEventSubscription {
String name() default "";
String description() default "";
boolean enabled() default false;
String handler();
String[] aspects() default {};
ThingworxSubscriptionEvent[] events() default {};
}Please help!

