Programmatically created query runs over all project areas instead over the requested one! Why?
Hi,
I am trying to deserialize the query definition xml file to expression with the following JAVA API -
XMLExpressionSerializer serializer = new XMLExpressionSerializer();
Expression expression = serializer.deserialize(queryString,
new WorkItemQuerySerializationContext("com.ibm.team.workitem.workItemType", projectArea));
Where "WorkItemQuerySerializationContext" extends the "AbstractSerializationContext" and provides the -
"com.ibm.team.workitem.workItemType" as a type and
projectArea instance as the origin/context of query execution.
But we have problem here, is - Once the expression has been constructed out of the query, I can't find the "Term" which explains about the context(Where to execute the query - project area) of the execution. (I am intended to execute the query expression in the defined/provided project area).
With this constructed expression, I am deriving the "IQueryDescripor" instance as below -
IQueryDescriptor queryFromExpression =
queryClient.createQuery(projectArea, "com.ibm.team.workitem.workItemType", queryName,
expression);
But - though i have provided the "projectArea" instance, to create the IQueryDescriptor, the execution of the same as below will result in the execution of the query descriptor over all the project areas of repository instead of intended one.
IQueryResult<IResolvedResult<IWorkItem>> resolvedResults =
queryClient.getResolvedQueryResults(queryFromExpression, loadProfile);
Later I am resolving the results to work items.
Questions -
1) Is the understanding of the context (WorkItemQuerySerializationContext) is correct?
2) Is there a problem in code?
3) Or am I missing anything else?
Please let me know if anyone knows about the issue.
Thank you in advane.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 08 '17, 10:04 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 08 '17, 10:13 a.m.praveen hanchinamani
Jun 08 '17, 10:22 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 08 '17, 10:35 a.m.Marko Tomljenovic
Jun 08 '17, 11:01 a.m.