REST query to DNG returns incorrect ordering
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
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.
Comments
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.
Can't thank you enough, would NEVER have found that on my own. I'll contact support somehow...
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!
Ali
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.
1 vote
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)
Another example of bug/unexpected behaviour that DNG is riddled with and unlikely to fix in existing versions of the product. We bought this product WAY to early in its development, it has a long way to go before its advantages outweigh its buggy behaviour.
2 other answers
Comments
Hi Donald,
You are correct, the "modules" query will return the artifacts in the correct order, and if I wanted to be super-safe I could even sort on book order.
However "modules" query does not return most of the information that "resources" does...for example the 'traceability' entry is completely omitted, as are the attributes. Of course I could use "modules" to obtain the 'about' of the artifact and then use a data source configuration to obtain the "resources" information but then this requires a reconfiguration every iteration which takes a very long time in a >500 artifact document with a complex RPE template.
I wouldn't have assumed that "resources?moduleURI=" returned artifacts in book order if it hadn't worked for months already, with a project full of people applying changes every day concurrently.
My question is an appeal if someone who knows if "resources?moduleURI=" is supposed to return book order so that I know if I've been lucky until now, or if this is unexpected behaviour.
Thank you for your suggestion.
Does sorting on Module Artifact "about" help? If so, you can use RPE's sort.
Comments
Hi Subramanya,
I haven't tried this, however I don't see how it would? As far as I can see "about" is the full URL to reach the resource, with the specific artifact indicated by its URI, e.g:
https://[host]:[port]/rm/resources/_1da2f623be39418a83ba183007710a37
These URIs are a combination of numbers and letters, and surely cannot be linked to book order as the URI is unique and constant throughout an artifact's life, whereas I could move the artifact indicated by the above "about" entry right now from position 3 to position 2.
However thank you for your help
Thanks Sam. I did not realize what is returned for "about". It should be <rrm:bookOrder> or something else. Sorry about that.
Comments
Alastair Beadle
Jan 30 '15, 4:54 a.m.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?
Sam Briggs
Jan 30 '15, 5:46 a.m.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