WSAttribute

Attributes provide a simple, extensible mechanism for attaching arbitrary data to component instances accessible through the API, either standard data like a campaign name, flowchart run input parameters like gender, or arbitrary custom data that is specified by another application or customer.

Note: In this API, attributes are used to model most component data, not only Unica Campaign custom attributes.

Components generally have many attributes that are associated with them, which are exposed by the CampaignServices API as a specially typed Map that is called an AttributeMap. Attribute data is represented as a typed concrete class throughout the API, such as WSDecimalAttribute, for attributes that contain decimal (double precision numeric) data.

Each attribute includes the following:

  • Name: the unique name of the attribute. This name serves as the key for accessing the attribute and its metadata within the component instance that it occurs. The format of the name is undefined; in some cases it is assigned by the service, by the client, or by an Unica Campaign user.

    Generally, this name is not the display name that would be presented to a Unica Campaign or client user. It may be standardized by the API, such as uacDescription, it might be assigned by Unica Campaign when publishing flowcharts, or it might be assigned by the application or customer when defining custom attributes. In all cases, however, the name is guaranteed unique.

  • Metadata: (optional) information about the attribute's data, such as value data type, display name, description, prompts, default value, select type, length (text), precision (decimals), options (if single or multiple select). See WSAttributeMetadata.
  • Values: an array of zero or more typed value objects. The values field is supplied by the concrete attribute class; the type of each value must be the same and agree with the type definition in the attribute's metadata field. Not all attributes support multiple values, however.
    The following concrete attribute types are supported:
    • WSBooleanAttribute: an attribute whose value is a boolean, that is, true or false.
    • WSIntegerAttribute: an integer value (java.lang.Long).
    • WSDecimalAttribute: a double-precision decimal number value (java.lang.Double).
    • WSCurrencyAttribute: a compound currency value, including an optional ISO 4217 currency code of the currency value, such as "USD" for the US dollar, and the currency values captured as a Double. If the currency code is not supplied, the default used by Unica Campaign is assumed.

      See http://www.xe.com/symbols.php for a list of countries, currency symbols, and codes. The locale that is used for a currency value might be different from a user's preferred locale.

    • WSCalendarAttribute: whose values are calendar dates, or datetimes, in some time-zone and locale.
    • WSTextAttribute: a string of Unicode text (possibly null, or empty).
Note: The list of possible attributes generally is different for each type of component, but the lists might overlap.