Skip to main content

API - Attribute

The attribute class provides read and write access to attributes of resources, activities and projects.

Fields

FieldTypeDescription
nameStringField name
groupStringField group
dataTypeStringData type identifier
stringValueStringString representation of value
mandatoryBooleanWhether field is mandatory
visibleBooleanWhether field is visible
editableBooleanWhether field is editable
activeBooleanWhether field is active
restrictionRestrictionValidation restrictions

The following data types are supported:

  • APPROVE / APPROVEREJECT - Approval/rejection boolean
  • BOOLEAN - Standard boolean
  • COMPOSE - Composed value
  • DATE - Date value
  • DECIMAL - Decimal number
  • FILE_MANAGEMENT - File handling
  • IDGENERATOR - Auto-generated ID
  • MULTISELECTLIST - Multi-select list
  • NUMBER - Integer/long
  • OWNED_OBJECTLIST - Owned object list
  • RESOURCE - Resource reference
  • ROOT_VALUELIST - Root value list
  • STATUS_ENGINE - Status engine
  • TEMPLATE_VALUELIST - Template value list
  • TEXT / TEXT_LONG - Text fields
  • USER - User reference
  • VALUELIST - 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;