Hi,
I recently set up Thingworx 8 locally. I imported the MQTT Extension from the marketplace and experienced strange behaviour that didnt happen in Thingworx 7.
1. A property of a MQTT-Type Thing publishes its value when it changes even if the property is only mapped as subscriber to a topic
2. I use a subscription script to update other properties depending on the JSON values of the subscriber property. This script subscribes to the datachange event. It fires and works ok if I update the value manually but fails if the property value is updated by MQTT.
The error in the log is as follows:
2017-08-08T12:03:34.766771900Z 2017-08-08 12:03:34.764+0000 [L: ERROR] [O: S.c.t.d.e.DSLProcessor] [I: ] [U: System] [S: ] [T: TWEventProcessor-15] User does not have visibility permission for InfoTa
bleFunctions
2017-08-08T12:03:34.780610200Z 2017-08-08 12:03:34.780+0000 [L: ERROR] [O: S.c.t.d.e.DSLProcessor] [I: ] [U: System] [S: ] [T: TWEventProcessor-15] Execution error in service script [Demonstrator_Dig
ital_Twin Event.DataChange:Property.FEMResultSubscriber] : Wrapped java.lang.RuntimeException: Entity [InfoTableFunctions] does not exist Cause: Entity [InfoTableFunctions] does not exist
2017-08-08T12:03:34.781367100Z 2017-08-08 12:03:34.780+0000 [L: ERROR] [O: c.t.s.s.e.EventInstance] [I: ] [U: System] [S: ] [T: TWEventProcessor-15] Throwable Error Executing Event Handler for event
Type.Thing:Entity.Demonstrator_Digital_Twin:Event.DataChange:Property.FEMResultSubscriber : Execution error in service script [Demonstrator_Digital_Twin Event.DataChange:Property.FEMResultSubscriber]
: Wrapped java.lang.RuntimeException: Entity [InfoTableFunctions] does not exist Cause: Entity [InfoTableFunctions] does not exist
2017-08-08T12:03:34.782576500Z 2017-08-08 12:03:34.782+0000 [L: ERROR] [O: c.t.s.s.e.EventInstance] [I: ] [U: System] [S: ] [T: TWEventProcessor-15] [message: Execution error in service script [Demon
strator_Digital_Twin Event.DataChange:Property.FEMResultSubscriber] : Wrapped java.lang.RuntimeException: Entity [InfoTableFunctions] does not exist Cause: Entity [InfoTableFunctions] does not exist]
The Code of my subscription is the following:
var decodedValue = eventData.newValue.value;
var createITParams = { infoTableName : "InfoTable", dataShapeName : "NamedVTQ" };
var properties = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(createITParams);
//Max Displacement Update
var row = new Object();
row.name = "MaxDisplacement";
row.value = decodedValue.max_displacement;
row.time = decodedValue.timestamp;
properties.AddRow(row);
Ok I solved Problem Nr.2 myself... It works if you go to the InfoTableFunctions Object in Thingworx and then execute the AddVisibilityPermission Service with principal: Everyone principaltype: Organization
Still wondering why I have to do this though