REST query to DNG returns incorrect ordering
Good evening,
I have been using RPE to publish reports from DNG (5.0.0) for a while now with good results. However as artifacts have been added to the modules I'm publishing, I have noticed a problem develop. Previously I would use a REST query for all resources found within a particular module, i.e: .../rm/publish/resources?moduleURI=xxxxxxxxxxxxx This has always returned the artifacts in the book order of the module, perfect for publishing. However I now see a smattering of artifacts, all at different positions within the module, created by different users, of different artifact types, that are returned at the end of the REST query, after the artifacts that should be the final ones. Specifically 10 artifacts out of the 522 in the module, appear out of book order, after the other artifacts that appear in the correct ordering. I decided that there must be no guarantee that artifacts using this query are returned in book order so I turned to something I assumed to be more robust: using a view. The view definitely shows the artifacts in book order. I use the query of the form: .../rm/publish/resources?moduleURI=xxx&projectURI=xxx&viewURI=xxx To my surprise this continues to return the same 10 artifacts out of book order, as do other views. This unpredictable behaviour is a real disaster for my document generation. Has anyone found this issue before? Sam |
Accepted answer
I did some debugging and re-read your post, and realized that you may hit the limitation of the API. When you use the "resources" API, RM sends a SPARQL query to the server with a "limit 512" (probably due to performance concern). For the returned artifacts, it sorts them by "bookorder", and that's why you can see them in perfect book order. It then sends another query to get the rest (if necessary, another 512), and sorts them, and so on. In your case, I suppose the 10 of them "out of order" are actually in order within the group of 10, right? I have not found a way to increase this limit to overcome this unfortunately.
RM does not impose such a limit with the "modules" API. Without knowing the actual design, I cannot say for sure whether it's limitation or a bug. I suggest you get in touch with Support and get a definite answer. Sam Briggs selected this answer as the correct answer
Comments
Sam Briggs
commented Feb 02 '15, 7:07 a.m.
Aha! I think that must be what is going on! I have checked and the REST query DOES indeed pass back 512 artifacts in ascending book order and then a further 10 artifacts - missing from the first chunk - in ascending book order.
Alastair Beadle
commented Feb 03 '15, 12:06 p.m.
Do you know if the 'views' API has a similar limit? I assume not as the example quitPrintModule templates use that as the data source. I ask as my templates are based on 'views' and although I have not seen this problem I don't think I have reached 512 objects yet and am concerned we will get the same issue eventually!
1
Donald Nong
commented Feb 04 '15, 11:04 p.m.
I don't see any LIMIT passed on to the "views" API. You can use the "size" request parameter to cap the result though, if you wish.
Sam Briggs
commented Jul 31 '15, 6:53 a.m.
Defect reported here 94418: REST API: RM sends a SPARQL query to the server with a "limit 512". This has been a known problem for some time (see related defect here 91574: module view wrong in create link to rows in module menu)
|
2 other answers
I am not sure whether the "resources" API guarantees order (note that you have a "book" only with a module) as you can put all sorts of filters with the API. If book order is critical to you, I suggest you use the "modules" API instead, and you will find <rrm:bookOrder> in the output.
Comments
Sam Briggs
commented Jan 30 '15, 5:54 a.m.
Hi Donald,
|
Hi Sam,
Does sorting on Module Artifact "about" help? If so, you can use RPE's sort. Comments
Sam Briggs
commented Jan 30 '15, 5:58 a.m.
Hi Subramanya,
Thanks Sam. I did not realize what is returned for "about". It should be <rrm:bookOrder> or something else. Sorry about that.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
It sounds like you are at a similar stage to me in CLM/RPE work but I have not yet seen this problem. I just re-ran my in-progress RPE template (uses the view as the main query) from a large module and the artefacts all appear to be in the correct order. But that module to date has only been edited by one user.
I am also on 5.0.0 but have fix 006 installed - I do not recall seeing any fixes relating to this specific problem but there were a few REST ones that I didn't pay much attention to at the time. It may be worth applying the patch if you have not already.
Edit: Another thought - have you tried one of the out-of-the-box RPE module templates to eliminate a template specific issue?
Hi Alastair,
Thanks for your response. Applying iFixes would be great, unfortunately I do not have access to our DNG server and IBM have spent the past 2 months trying to set up our 5.0.2 production server so I'm reluctant to persuade people to update our server for what may turn out to be only a fortnight.
Furthermore this is NOT an RPE issue (although I discovered it this way). when I retrieve the XML in my web browser using the REST query the data is returned in this incorrect ordering, be it with resources OR view.
Thanks for your suggestions
Sam