cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Multiple query filter not working with QueryPropertyHistory

ahawaldar-2
6-Contributor

Multiple query filter not working with QueryPropertyHistory

Hi,

I have written a new Service which calls the QueryProperyHistory of one of Thing in java. The query to this QueryProperyHistory  service uses and filter. below is the query json


{

"filters": {

     "filters": [{

          "fieldName": "Thing",

          "type": "EQ",

          "value": "Bogie1"

          }, {

         "fieldName": "condition_predicted",

         "type": "EQ",

          "value": "2.0"

          }],

          "type": "AND"

     }

}

I am getting below error. However If I paste the above query directly while executing QueryProperyHistory  from composer it works fine, but when I invoke the same service in Java , its not working.


java.lang.Exception: No filters were defined for AND expression

        at com.thingworx.types.data.filters.FilterFactory.createFilter(FilterFactory.java:122) ~[thingworx-common-7.4.3-b38.jar:na]

        at com.thingworx.types.data.filters.FilterParser.ParseFilters(FilterParser.java:22) ~[thingworx-common-7.4.3-b38.jar:na]

        at com.thingworx.types.data.queries.Query.parseQuery(Query.java:47) ~[thingworx-common-7.4.3-b38.jar:na]

        at com.thingworx.types.data.queries.Query.parseQuery(Query.java:66) ~[thingworx-common-7.4.3-b38.jar:na]

        at com.thingworx.things.Thing.QueryPropertyHistory(Thing.java:7750) [thingworx-platform-common-7.4.3-b38.jar:na]

0 REPLIES 0
Top Tags