How to search all the retired asset information
I used the following codes try to search all the retired assets in our RAM:
*************************************************** RAMAssetQueryBuilder queryBuilder = new RAMAssetQueryBuilder(session); RAMState state = session.getState("Retired"); queryBuilder.addSearchFilter(state); SearchResult searchResult = session.getAssets(queryBuilder); AssetSearchResult[] assetResults = searchResult.getAssetSearchResults(); for(int i=0;i<assetResults.length;i++){ AssetSearchResult aresult = assetResults[i]; aresult.getAsset().getIdentification(); } ******************************************************** In RAM UI, the total retired assets number is 208 . My testing result like this: 1) AssetSearchResult[] assetResults its length is always 100 2) searchResult.getTotalResultsCount() number can be 208, but how to get these assets id and version? 3) If I set the max search result as a very big number like following codes: queryBuilder.setMaxResults(100000000); Then assetResults.length can be 208. But is the default max result is 100? How we set it as no limit? 4) The strange thing is the result number is not fixed, one time I get 208 results and next time is 210. In our RAM server the assets not changed and I tested 6 times with above codes, half of them the searchResult.getTotalResultsCount() shows as 208 correct value, but the other 3 times is 210. We are using RAM 7511 java API right now, is there any change? |
One answer
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.