Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Latest version of Assets using RAMAssetQueryBuilder

Hi,

I'm trying to do a search using the RAMAssetQueryBuilder that will only return the latest version of the Assets it finds. The default is to return all versions and this is a very large set. I realize that I can get the latest version of a single Asset if I use the session.getAsset method but this will not work for our usage.

Is there anyway I can construct a RAMAssetQueryBuilder that will return a set of Assets with just the most recent version of each?

Many thanks.

Des Drury

0 votes



4 answers

Permanent link
RAM 7.5.1 will introduce this concept in the web UI, but it's not available from the API yet. This is an enhancement we could open and consider for one of our upcoming service packs.

I have a question about how you would expect the feature to work. Say you have 'Asset A' with versions 1 and 2. You perform a search that matches version 1, but not version 2. Would you expect that
a) Version 1 is returned because it's the latest version that matches your query
b) Version 2 is returned because it's the latest version of the asset even though it does not match your query
c) No results are returned because although version 1 matched your query, it was not the latest version of the asset and version 2 of the asset does not match your query.

In RAM 7.5.1 the web UI works similar to option a.

0 votes


Permanent link
RAM 7.5.1 will introduce this concept in the web UI, but it's not available from the API yet. This is an enhancement we could open and consider for one of our upcoming service packs.

I have a question about how you would expect the feature to work. Say you have 'Asset A' with versions 1 and 2. You perform a search that matches version 1, but not version 2. Would you expect that
a) Version 1 is returned because it's the latest version that matches your query
b) Version 2 is returned because it's the latest version of the asset even though it does not match your query
c) No results are returned because although version 1 matched your query, it was not the latest version of the asset and version 2 of the asset does not match your query.

In RAM 7.5.1 the web UI works similar to option a.


Hi,

I agree that option a is the best solution. Option b would be confusing as you are not getting what you ask for. Option c would also be confusing as I think what you want is the latest version of an Asset that matches your query, i.e. option a.

As long as the query was quite general, i.e. all Assets of a particular type and name, then you would always get the latest version with option a, which is exactly what we are after.

To be honest I find the fact that all versions are returned by a query to be confusing. As you can always access a previous version of an Asset by going into it and clicking on one of the version links. My expectation of the query is that it should return a set of unique Assets that match the query at their most recent version.

If this behavior could also be implemented in the API that would be great. However, if it is going to be implemented in the GUI then is there some hints you can provide to me about how I might be able to code a similar solution using the current API? I've looked at the Lucene syntax and see no way to implement this functionality using it.

Cheers.

Des

0 votes


Permanent link
Hi

Using the current API, I would suggest sorting the asset results by GUID and then walking through the results, picking out the highest version number for each GUID. Unfortunately this is a manual process until the feature is added to the API.

0 votes


Permanent link
yep.... note that the term "latest" version is not a black and white one.

e.g., it can be the latest "compatible" version ... e.g., latest fix from Ver.Minor.Fix

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Oct 21 '11, 1:19 a.m.

Question was seen: 8,868 times

Last updated: Oct 21 '11, 1:19 a.m.

Confirmation Cancel Confirm