It's all about the answers!

Ask a question

Rational Doors 5 | Programmatic sorting of artifacts within a module


Rohit M (134) | asked Dec 20 '15, 1:40 p.m.
edited Dec 20 '15, 5:27 p.m.
 We are inserting artifacts to several hundred modules programmatically using OSLC apis - the individual modules, therefore, will grow in size as more and more artifacts are added to them (this activity spans several weeks as business rules are being extracted and added as artifacts that are then linked to multiple modules).Since the insertion within a module follows no particular sequence,so module aggregates the artifacts in insertion order.

Now, as soon as the project concludes, there will be a need to order the artifacts inside each of these modules systematically and so we need to have a plan for that now.

Is there a way we can attach some meta data within the artifacts that can help programmatically sort the modules later.

Just a thought below (I have not tested any of these)  let me know if any of these options are viable:
1. Tag artifacts during the automated upload with tag attributes containing numeric keys (so a lower tag value should be placed before than the higher tag value) when the sorting activity commences. Any other options besides tagging that can help accomplish this?
2. Also, if we do tag them with numeric keys (that represents their implicit ordering), are there exposed api methods a custom program can use (could be OSLC/Lyo/Custom javascript client extension based) to sort based on the tag keys? If yes,could you point to any blog or sample code/api methods I can refer to?




Accepted answer


permanent link
ian green (17814) | answered Dec 21 '15, 3:24 a.m.
JAZZ DEVELOPER
Hello Rohit
You cannot set a tag on an artefact using the OSLC API, so solution 1 won't work.  You could on the other hand set a user-defined attribute (say of datatype string, with values like 1, 1.1, 1.2.2 etc which indicate the desired position in the module).

The only API to module structure is the JavaScript client extension API [1], which would allow you to reorder based on, for example, that user-defined attribute value.

FYI, we're currently in the design phase of extending the DNG server API to better support modules.

cheers
-ian


[1] https://jazz.net/wiki/bin/view/Main/RMExtensionsMain
These pages define the client extension API, and also provide examples and instructions for getting started.
Rohit M selected this answer as the correct answer

Your answer


Register or to post 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.