1 Reply Latest reply on Jan 17, 2018 10:34 AM by drichter RSS
    drichter Apprentice

    TWX 8 have trouble with unterlines in JSON

    Hey everyone,


    I made a application with MQTT communication (receiving JSON messages) on ThingWorx 7.2.


    Now I working with ThingWorx 8 and use the same application, but now I get error if the JSON messages properties include a underline ( _ ).


    For example I get messages like this









    "CO2_concentration":599.39 }


    I the datachange subscription of the sensor I do this


    me.temp = newVal.temp;

    me.humidity = newVal.humidity;


    me.CO2concentration = newVal.CO2_concentration;


    And I get a error: Execution error in service script [climateSensor_3 Event.DataChange:Property.MQTTValue] : Wrapped java.lang.NullPointerException Cause: null


    My next step was to check every property set via logger


    me.temp = newVal.temp;

    logger.debug("set temp");

    me.humidity = newVal.humidity;

    logger.debug("set humidity");


    me.CO2concentration = newVal.CO2_concentration;

    logger.debug("set CO2_concentration");


    Now I get the error before the "set CO2_concentration" is logged.


    I change the


    me.CO2concentration = newVal.CO2_concentration;




    me.CO2concentration = newVal.CO2concentration;


    and change the JSON messages and everything works well.


    Why ThingWorx 8 not supported underline in JSON messages? Can I change this behaviar?