It's all about the answers!

Ask a question

How to Create Category Values using REST and JAXB


Daniel Chirillo (1801823) | asked Apr 02 '16, 12:37 p.m.
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. 




One answer



permanent link
Daniel Chirillo (1801823) | answered Apr 02 '16, 1:01 p.m.
Problem solved:  set the href of the Category.CategoryType to the href of the POSTed CategoryType.

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.