Skip to main content
1-Visitor
November 27, 2019
Solved

ThingWorx custom extension service parameter of type InfoTable

  • November 27, 2019
  • 2 replies
  • 3826 views

Hello,

 

Currently I´m facing some issues writing a custom Java Extension that has a service with a parameter of type InfoTable.

The Service parameter is annotated like this:

@ThingworxServiceParameter(name = "param", description = "", baseType = "INFOTABLE", aspects = {"isEntityDataShape:true", "dataShape:TestDataShape" }) InfoTable param

 

Here the baseType is set to "InfoTable" and in the aspects array a DataShape is pointed that exists on the ThingWorx platform.

 

When I try to execute the Service interactively and want to enter the parameter values I get the following message: 

NoDatashape.png

I am using ThingWorx 8.4.5-b102 and I am pretty sure this has been working with ThingWorx 7.4.

 

Has anybody any adivce or can reproduce this issue?

 

Thanks,

Keijo

Best answer by slangley

Hi @sburton-3.

 

It appears we have a fix coming for this issue in the 9.0 release.  The target date for 9.0 is June (but is subject to change).

 

However, a workaround is to use the AddStreamEntries service in a custom service.  This way you can define your infotable with the data shape needed to pass to the service.

 

Regards.

 

--Sharon

2 replies

16-Pearl
December 2, 2019

Hi Keijo,

 

Can you try to remove the "isEntityDataShape:true" aspect ?

 

1-Visitor
March 27, 2020

I have the same issue using an INFOTABLE as a configuration item on a custom ThingTemplate from an extension I have created. 

 

Since I have also seen this error come up with some of the out of the box services on other Thingworx objects, I believe that this a bug in the Thingworx Composer on Thingworx 8.4.x (I do not see this on version 8.2 in the old Composer) where any popup requiring a DataShape definition does not seem to correctly retrieve that definition, even though a DataShape is defined.

Support
March 27, 2020

Hi @kbuss and @sburton-3.

 

Can you each provide your extensions so we can test it here? We may need your source as well.  You can send this under private email.

 

Also, for the out-of-the-box services you're seeing this with under 8.4, please provide a list.

 

Regards.

 

--Sharon

1-Visitor
March 27, 2020

I was able to work around the issue by exposing the INFOTABLE as a Property on the Thing rather than as a Configuration item. 

 

In other words this doesn't work as expected ...

@ThingworxFieldDefinition(name = "MessageHeaderProperties", description = "", baseType = "INFOTABLE", ordinal = 0, aspects = { "isEntityDataShape:true", "dataShape:CAT.ServiceBus.CustomHeaders.DS" })

 

Yet this does ...

@ThingworxPropertyDefinition(name = "MessageHeaderProperties", description = "", category = "Configuration", baseType = "INFOTABLE", isLocalOnly = false, aspects = {
"isPersistent:true", "dataChangeType:OFF", "isEntityDataShape:true",
"dataShape:CAT.ServiceBus.CustomHeaders.DS" }),

 

In terms of the out of the box services - we were seeing the same issue with AddStreamEntries() on a Stream that was using InfluxDB as a persistence provider. However, when we downgraded Influx to a slightly older version at the request of PTC tech support, this issue appears to have resolved itself.