OData Classification search on numerical and boolean values
Windchill 11.1
OData API 2.2.2
Hello all,
I am trying to retrieve / filter on classification (parts) via the OData classification search, However, data types are either not mapped correctly or I need to use a different leaf node - I just do not know which one.
Here are some examples:
1) Filtering by a boolean attribute:
WORKS:
Request:
/Windchill/servlet/odata/v3/ClfStructure/ClfNodes('NODE_NAME')/ClassifiedObjects?$filter=ClassificationAttributes/any(d:d/InternalName eq 'SOME_ATTRIBUTE' and d/DisplayValue eq 'true')
DOES NOT WORK:
Request:
/Windchill/servlet/odata/v3/ClfStructure/ClfNodes('NODE_NAME')/ClassifiedObjects?$filter=ClassificationAttributes/any(d:d/InternalName eq 'SOME_ATTRIBUTE' and d/DisplayValue eq true)
Response:
{
"error": {
"code": null,
"message": "The types 'Edm.String' and 'Edm.Boolean' are not compatible."
}
}
However, the attribute's type clearly is a boolean, so this last request should work according to the OData specification.
2) One of our requirements is to filter by numerical values, which cannot be done at all:
Request:
/Windchill/servlet/odata/v3/ClfStructure/ClfNodes('NODE_NAME')/ClassifiedObjects?$filter=ClassificationAttributes/any(d:(d/InternalName eq 'SOME_ATTRIBUTE' and d/DisplayValue ge 61.5))
Response:
{
"error": {
"code": null,
"message": "The types 'Edm.String' and 'Edm.Decimal' are not compatible."
}
}
Casting the (required) string value to a double will also produce an error:
Request:
/Windchill/servlet/odata/v3/ClfStructure/ClfNodes('NODE_NAME')/ClassifiedObjects?$filter=ClassificationAttributes/any(d:(d/InternalName eq 'SOME_ATTRIBUTE' and (Edm.Double)d/DisplayValue ge cast('61.5', Edm.Double))
Response:
{
"error": {
"code": null,
"message": "The types 'Edm.Double' and '[Boolean]' are not compatible."
}
}
The reason (IMO) might be that these nodes have some kind of internal data type that combines both values and their unit (e.g. "mm").
Could anyone please point me in the right direction as how to apply proper numerical / boolean filters for the classification search? I'd be very much obliged.
Best regards

