It's all about the answers!

Ask a question

Categorizing Assets at the Category level


Abhilash Boinapally (011314) | asked Aug 20 '12, 3:02 a.m.
 Hi,
         We have a category schema structure like below.
                     Schema-->Category-->subcategory (all are check boxes).
          But we would like categorize at the "Category" level Only. How do we achieve this Using Java code.
          
In the API we saw that for Categorization we require a string. In our case we don't have any value for string because we want the categorization as schema/category
          asset.categorize(categorzation,string);
           
Please suggest.Thanks in advance

Regards,
Abhilash

One answer



permanent link
Gili Mendel (1.8k56) | answered Aug 20 '12, 10:07 a.m.
JAZZ DEVELOPER
edited Aug 20 '12, 10:09 a.m.
Categorization in ram is structured as following:

   Schema:Category->SubCategory->SubCategory .....

   Assume: Software Development:Kind->Service->Interface

 
        RAMSession session = new RAMSession("https://server.ram/",  "uid",  "passwd");
	session.setWebServiceTimeout(10000);
	RAMAsset asset = session.getAsset(new AssetIdentification("FC506B15-2A91-D60A-5995-B110045F26D0", "1.0"));        
	RAMCategorySchema schema = session.getCategorySchema("Software Development");                
	RAMCategory cat = (RAMCategory)schema.getCategory("Kind");                
	RAMSubCategory sub = (RAMSubCategory)cat.getSubCategory("Service/Interface");
	asset.categorize(sub);
	session.put(asset, new NullProgressMonitor());
	session.release();        
	
	
	

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.