RAM API: Is there a way to create a Search Subscription for a particular User?
From a web browser, when you access Rational Asset Manager, go to Assets (or Search). Once you Filter your search, there is an orange flag on the right side that you can click to "Subscribe to this search".
Is there any way from the RAM API that you can create a subscription like this for a user?
We are using RAM 7.5.2.1. Thanks.
- Troy Klomp
Is there any way from the RAM API that you can create a subscription like this for a user?
We are using RAM 7.5.2.1. Thanks.
- Troy Klomp
2 answers
Hi, Try RAMSubscription. One could add a subscription like:
SearchQuery query = session.createAssetQuery("asset");
RAMAssetQueryBuilder queryBuilder = (RAMAssetQueryBuilder)query;
SearchResult result = session.getAssets(queryBuilder);
for(AssetSearchResult assetRe:result.getAssetSearchResults()){
RAMAsset asset = session.getAsset(assetRe.getAsset().getIdentification());
asset.addSubscription(new RAMSubscription("my sub", session.getUser("admin")));
try{
session.queueAssetForPut(asset);
}catch(Exception e){
e.printStackTrace();
//if asset locked. ignore
}
}
PS: use RAMSubscription.setFrequency to make a weekly subscription.
Comments
1 vote