Error while invoking the wmtmqueryDocumentQuery service through a java progarm

Are you calling wm.tm.query.CreateDocumentQuery first? That returns an object in the pipeline that needs to be passed to wm.tn.query:documentQuery.

Hi Rob,

Thanks for your response.

Yes Iam calling the CreateDocumentQuery and the output query obj is passed on to the DocumentQuery input record.

Herez a portion of the code

IData createDQOutput = context.invoke(“wm.tn.query”, “createDocumentQuery”, inputRecord);
IDataCursor idc=createDQOutput.getCursor();
idc.first(“query”);
query=idc.getValue();



public IData setInputForDocumentQuery()
throws IOException, ServiceException
{
IData out = IDataFactory.create();
IDataCursor idc = out.getCursor();
idc.insertAfter(“query”,query);
idc.insertAfter(“aggregate”, “false”);
idc.insertAfter(“disablePaging”, “true”);
idc.insertAfter(“pageSize”, null);
idc.insertAfter(“maxRowCount”, null);
idc.insertAfter(“queryTimeout”, null);
idc.insertAfter(“threshold”, null);
idc.destroy();
return out;
}

Hmmm. Given the exception states “java.lang.ClassCastException: com.wm.util.Values” you might try using a Values object for the pipeline vars instead of IData.

Hi Rob,

No Luck. I get the same error message after using values.
I beleive that since the output of CreateDocumentQuery is ComplexDocQuery and the input required for Document is SimpleDocQuery, this error is thrown up.
Do we have any way wherin we can get SimpleDocQuery from ComplexDocQuery.

Thanks and regards

Rahul