Skip to main content
Participating Frequently
Mar 7, 2022 8:06 PM UTC
Question

Error converting query output to CDT

Hello,

I am getting the below error when querying a particular table from the application. The entity I am querying is a nested CDT. 

Expression evaluation error in rule 'dcm_getproductbycaseid' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Error converting query output (rule: [DCM_getProductByCaseId], type: [DCMCaseProductDT3274], objects successfully converted: [0]

Server Log file 
Caused by: com.appiancorp.suiteapi.common.exceptions.AppianRuntimeException: com.appiancorp.suiteapi.common.exceptions.AppianException: Error converting query output (rule: [DCM_getProductByCaseId], type: [DCMCaseProductDT3274], objects successfully converted: [0]) (APNX-1-4164-025)
at com.appiancorp.type.external.teneoimpl.QueryRuleExceptionHandler.handle(QueryRuleExceptionHandler.java:50)
at com.appiancorp.type.external.teneoimpl.TimedWorkRunner.run(TimedWorkRunner.java:62)
at com.appiancorp.type.external.teneoimpl.TeneoQueryExecutor.execute(TeneoQueryExecutor.java:115)
at com.appiancorp.type.external.teneoimpl.TeneoDataStore.query(TeneoDataStore.java:753)

Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EClassImpl cannot be cast to org.eclipse.emf.ecore.EDataType
at com.appiancorp.type.data.ecore.PrimitiveTypeEcoreConverter.fromEmfValueViaString(PrimitiveTypeEcoreConverter.java:79)
at com.appiancorp.type.data.ecore.StringEcoreConverter.fromEmfValue0(StringEcoreConverter.java:47)
at com.appiancorp.type.data.ecore.PrimitiveTypeEcoreConverter.fromEcoreValue(PrimitiveTypeEcoreConverter.java:65)
at com.appiancorp.type.data.ecore.EcoreConverter.fromEcoreTypedValue(EcoreConverter.java:28)

But I am able to get data using SQL SELECT statement.

Please help me on this if anyone know or have experience on how to fix this. Thank you 

    2 replies

    gopalk2865
    Participating Frequently
    Mar 9, 2022 8:58 AM UTC

    HI , Did you make any changes to cdt? if you did , was it working earlier?and looks like you are using query rule, can you check that rule?

    viraty527193
    Inspiring
    Mar 9, 2022 11:27 AM UTC

    Hi  can you please put the code for Query Entity and the structure of the CDT here, to better understand what you are trying to achieve?