Red Hat Training

A Red Hat training course is available for Red Hat JBoss Operations Network

4. Setting Method Variables to String

Some types of information have a integer value within the database but the information given in the API has a string value. This is common for search filters which depend on a category; the category has a user-friendly string name and an internal integer.
Attempting to pass the string value when the server expects an integer causes the operation to fail with an error that it cannot find the method.
rhqadmin@localhost:7080$ groupcriteria = new ResourceGroupCriteria();
rhqadmin@localhost:7080$ groupcriteria.addFilterGroupCategory('MIXED')
Can't find method org.rhq.core.domain.criteria.ResourceGroupCriteria.addFilterGroupCategory(string). (<Unknown source>#1)
To use the user-friendly string in script, append the .toString method with the remote API method.