The AddXXXMessages or EditXXXMessages classes are only used internally, but are included for documentation purposes. For example, AddRoleMessage describes what fields are required for adding a Role, and EditRoleMessage describes what additional fields should be set when editing. The XXXMessages interfaces cannot be used by EJB or SOAP users (XXXBean classes must be used instead), but are included to help with documentation.
Applying the same process as before to search for a class in the JavaDocs, we can locate the AddRoleMessage class. Once it has been found in the com.attask.beans.api package, the documentation indicates, under the Method Details section, that the following fields have to be set: setMaxUsers, and setName. A quick check is to look at the setXXX methods found under the Method Details as seen in Figure 2.3, and then read the requirements for those methods in the detail section. As you can see setName is a required field, while set description is not.
When accessing the EditRoleMessage interface there is only one required setXXX method, named setID, but this is in addition to the methods listed for AddRoleMessage.
In some cases the fields that must be set are enumerated fields. These values are identified by the "Enum" suffix. For example, the TaskStatusEnum class includes the values New, In Progress, and Complete. To determine which values are enumerated, access the com.attask.common.constants package in the JavaDocs. To find all of the enumerated values found in @task please refer to the sdk_4_0/client/docs/api/com.attask.common.constants. Search for the enumerated class and search the Field Summary section for all of the static methods. An exemplary Field Details section is depicted in Figure 2.4.
The Field Detail information can be accessed from the Field Summary section. Following the above example, the enumerated values for New, In Progress, and Complete, are respectively: "NEW", "INP", and "CPL". Whenever a TaskBean is retrieved, the Task Status will return one of these values. When editing the bean these values should be passed in.
Selecting one of the links such as New will display the associated description of that field and any constraints it has. There are enumerated values that have a raw value associated with them. For example, some issues have a field name Priority that ranges from Low to Urgent. The raw value is a range from 1-5, Low being 1 and Urgent being 5. There is no difference in choosing the enumerated value or the raw value.
NOTE: When Adding and Editing objects be careful to retrieve the object first, via a "get" method, and change the fields that need to be updated. If you do not retrieve the object first, all fields that are not populated will end up being set to null.