03-30-2012 07:08 PM
I've done the following query two ways:
Using parent/child in Studio.
Using NXQL query in Studio and get the same error. Here is the NXQL.
SELECT * FROM Document WHERE ecm:isCheckedInVersion = 0 AND ecm:parentId = '@{Context["TRAVELERID"]}' AND ecm:primaryType = '@{Context["NEXTRECIPEDOCTYPE"]}' AND ecm:currentLifeCycleState = '@{Context["NEXTRECIPESTARTSTATE"]}'
All of the context variables resolve correctly in both cases. I have used similar queries in content views with success.
I get the following error:
org.nuxeo.ecm.automation.core.collectors.DocumentModelCollector cannot be cast to org.nuxeo.ecm.core.api.DocumentModel
I basically have a container document that has just made a state transition and I want to select one of the documents in the container. The query is trying to retrieve the "now active" document context so I can edit the metadata.
Any suggestions on what is wrong and how to troubleshoot this effort!?
04-04-2012 06:27 PM
I found the automation chain I was calling did not return a document this was by my design. I was using Run Document Chain which expects a document or documents to be returned. Since nothing was returned (the end result of the called chain was a task being queued) the casting error was thrown.
The Fix:
Changing the the Automation command to Run Chain fixed the casting issue.
04-03-2012 12:56 PM
After digging a bit in the code it appears the public class OperationServiceImpl which implements AutomationService returns a DocumentModelCollector rather than a DocumentModel which produces the error above.
04-03-2012 01:00 PM
I also tried Get Children rather that Get Child and go the same error.
04-03-2012 08:20 PM
My container document has several documents of different types. It appears the DocumentModelCollector returns a document model list. Which then returns each DocumentModel contained in the parent document. For some reason the DocumentModelCollector itself is being returned NOT each individual DocumentModel.
04-04-2012 06:27 PM
I found the automation chain I was calling did not return a document this was by my design. I was using Run Document Chain which expects a document or documents to be returned. Since nothing was returned (the end result of the called chain was a task being queued) the casting error was thrown.
The Fix:
Changing the the Automation command to Run Chain fixed the casting issue.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.