API - Attribute
The attribute class provides read and write access to attributes of resources, activities and projects.
Fields
| Field | Type | Description |
|---|---|---|
name | String | Field name |
group | String | Field group |
dataType | String | Data type identifier |
stringValue | String | String representation of value |
mandatory | Boolean | Whether field is mandatory |
visible | Boolean | Whether field is visible |
editable | Boolean | Whether field is editable |
active | Boolean | Whether field is active |
restriction | Restriction | Validation restrictions |
The following data types are supported:
APPROVE/APPROVEREJECT- Approval/rejection booleanBOOLEAN- Standard booleanCOMPOSE- Composed valueDATE- Date valueDECIMAL- Decimal numberFILE_MANAGEMENT- File handlingIDGENERATOR- Auto-generated IDMULTISELECTLIST- Multi-select listNUMBER- Integer/longOWNED_OBJECTLIST- Owned object listRESOURCE- Resource referenceROOT_VALUELIST- Root value listSTATUS_ENGINE- Status engineTEMPLATE_VALUELIST- Template value listTEXT/TEXT_LONG- Text fieldsUSER- User referenceVALUELIST- Single value list
Getters
// Basic getters
String getName();
String getGroup();
boolean isActive(); // @deprecated
boolean isChanged();
String getDataType();
String getValueAsString();
String getDisplayName();
boolean isEmpty();
// Type-specific getters
Long getValueAsLong();
BigDecimal getValueAsDecimal();
Date getValueAsDate();
Boolean getValueAsBoolean();
User getValueAsUser();
String[] getSelectedStringValues();
Resource[] getOwnedObjectList();
Resource getSelectedValue();
Resource[] getSelectedValues();
Restriction getRestriction();
Setters
// Type-specific setters
void setValueAsString(String value) throws DataAccessException;
void setValueAsLong(Long value) throws DataAccessException;
void setValueAsDecimal(BigDecimal value) throws DataAccessException;
void setValueAsDate(Date value) throws DataAccessException;
void setValueAsBoolean(Boolean value) throws DataAccessException;
void setValueAsUser(String userId) throws DataAccessException;
// Collection setters
void setSelectedStringValues(String[] values) throws DataAccessException;
// Property setters
void setMandatory(Boolean mandatory);
void setVisible(Boolean visible);
void setEditable(Boolean editable);
// Special operations
void copyFromAttribute(Attribute sourceAttribute) throws DataAccessException;