Adding a category to an asset in a custom policy
Hello
I need to create a custom policy that will add a category to an asset. I've been digging through the Java API and think I have a good approach, but it is not working. My code looks like this...
However, this gives me an exception...
exception java.lang.NullPointerException stack trace=[com.ibm.ram.client.RAMCategorySchema.setDirty(RAMCategorySchema.java:411), com.ibm.ram.client.RAMCategory.setDirty(RAMCategory.java:415), com.ibm.ram.client.RAMSubCategory.setDirty(RAMSubCategory.java:432), com.ibm.ram.client.RAMSubCategory.setSubCategories(RAMSubCategory.java:706), com.ibm.ram.client.RAMCategory.setSubCategories(RAMCategory.java:474), ......
What is the correct way to categorize an asset via a custom policy? I've tried many variations of the above, but keep hitting exceptions of one kind or another.
Thanks for any help!
|
Accepted answer
Well, I was making this harder than it needed to be. Plus i skipped over the part of the documentation that actually answered by question!
From the IBM documentation found here >
Extending Product Function > Extending Rational Asset Manager > Using Rational Asset Manager Java API > Work with assets > Create, modify, or delete assets > Categorize an asset
Rich Kulp selected this answer as the correct answer
Comments
Pramod Chavan
commented Dec 20 '13, 2:07 a.m.
getSubCategory("SubCategory-Name"); this method does not work when the input argument "sub-category-name" has backslash(/).
E.g: getSubCategory("sub/category") --> returns null
Please let me know if there is any workaround for this. I tried to eescape it by placing \ before /, but did not work.
|
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.