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

How to Create Category Values using REST and JAXB

I'm trying to create category values using RQM REST and the JAXB classes generated from the QM schemas.  From examining the XML content of the  /category and /categoryType feeds:

1.  What the qm UI calls a category is  CategoryType (JAXB class)
2.  What the qm UI calls a category value is a Category (JAXB class)
3.  A Category is associated with a CategoryType.

I'm able to create categories by POSTing CategoryType objects:
CategoryType catType = new CategoryType();
catType.setTitle("Country");
catType.setProjectArea(projectArea);
catType.setScope("TestPlan");
catType.setRequired(false);
catType.setMultiSelectable(false);

I'm dead in the water trying to create and associate values, i.e., create and associate a Category with a CategoryType. 

As far as I can tell, you make the association by invoking setCategoryType() on the Category.  The challenge is that the argument to setCategoryType()  needs to be a Category.CategoryType -- not the CategoryType used to create the CategoryType. 




0 votes



One answer

Permanent link
Problem solved:  set the href of the Category.CategoryType to the href of the POSTed CategoryType.

1 vote

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
× 10,952

Question asked: Apr 02 '16, 12:37 p.m.

Question was seen: 2,926 times

Last updated: Apr 02 '16, 1:01 p.m.

Confirmation Cancel Confirm