# Attribute types

The following lists the different attribute types that you can create and use in Axway Decision Insight (DI).

## Simple types

### String

This type is used to store a sequence of characters.

### Boolean

This type  has only two possible values:  `true` and  `false`. It is used as a simple flag that tracks true/false conditions.

### Numeric types

In DI, numeric attributes can be integer or decimal types.

• An Integer value is a 64-bit two's complement integer.
• the minimum representable value (called `Integer MIN_VALUE`) is -263 = -9223372036854775808
• the maximum representable value (called `Integer MAX_VALUE`) is 263-1 = 9223372036854775807.
• A Decimal value is a floating point type associated to double precision 64-bit format IEEE 754 value.
• The minimum representable value (called `Decimal MIN_VALUE`) 2 -1074 ~4.9 E-324
• The maximum representable value (called `Decimal MAX_VALUE`) is  (2-2 -52)·21023 ~ 1.7976931348623157 E308.
• The Decimal data type defines three special values:
• Negative infinity
• Positive infinity
• NaN. Stands for Not A Number. It is used to represent a value that does not represent a real number. For example 0/0 is undefined as a real number, and so represented by NaN.

A Decimal value can hold Integer values. So, if you define a function as  `Decimal Compute`(Decimal input1, Decimal input2), you could also use that function with 1 decimal input and 1 integer input or two integer inputs.

### Time related types

• Duration – To define an amount of time. Internally, this is actually an integer amount of milliseconds. Thus, the min value is -263 millis and  the max value is 263-1 millis.
• CalendarDuration –To define an amount of time using a custom unit, which can  be" millisecond", "second", "minute", "day", "week", "month", "year". Using this type of duration allows to address issues linked to:
• Minutes lasting more than 60 seconds (leap seconds).
• Days lasting 23 or 25 hours (daylight time changes).
• Months lasting from 28 to 31 days.
• Years lasting from 365 to 366 days.
• Instant – To define an instant in the date/time continuum.
• Interval – To define an interval of time between two instants start and end. By default, an interval is inclusive of the start instant and exclusive of the end instant.

## Complex types

### Classifier

This type is used to represent a classification. It contains an ordered list of instances that are the different states of that classification. Its value is composed by the following properties:

Property Description
Value the selected instance UUID
Label the selected instance name
Rank the selected instance rank (0-based index)
Example of value
```{
"Value": "00000002-0001-0000-130b-29020cc02800",
"Label": "NORMAL",
"Rank": 0
}```

### Baseline

A baseline is an initial collection of data on a given period, used as a basis for measuring or comparing past data with the current data.

Having a baseline is important to define how you expect your company data to evolve and determine what qualifies as a normal situation as opposed to an unexpected one. Baselines enable you to define a pattern for standard data, thresholds, etc. to see whether your current data matches the pattern or not.

The value of a baseline is composed of the following properties:

 average the mean of the data values standardDeviation the dispersion of the data values

The properties can be Decimal or Duration.

Example of value
```{
"average":"13",
"standardDeviation":"1.2"
}```

### Thresholds

This type defines a mapping between ranges of values and a classifier instance.

Its value is a List of rules

Each rule is a greater than comparison from a threshold value with an associated classifier instance.
A rule is composed by the following properties:

 classifier the associated classifier instance label (mandatory) threshold the value to compare with (not set for default value) included either the threshold is included or not (not set for default value)if true, we use a greater than or equals comparison, if false, we use a greater than comparison.

The threshold property can be Decimal, Duration, Integer, Instant or String.

### Examples

Evaluation type Value
```{
"rules": [
{
"classifier": "CRITICAL",
"threshold": 2,
"included": false
},
{
"classifier": "WARNING",
"threshold": 1,
"included": false
},
{
"classifier": "NORMAL",
"threshold": -1,
"included": true
},
{
"classifier": "WARNING",
"threshold": -2,
"included": true
},
{
"classifier": "CRITICAL"
}
]
}```
```{
"rules": [
{
"classifier": "CRITICAL",
"threshold": 10,
"included": false
},
{
"classifier": "WARNING",
"threshold": 5,
"included": true
},
{
"classifier": "NORMAL"
}
]
}```
```{
"rules": [
{
"classifier": "NORMAL",
"threshold": 5,
"included": true
},
{
"classifier": "WARNING",
"threshold": 0,
"included": false
},
{
"classifier": "CRITICAL"
}
]
}```

### Dispersion multipliers

This type defines a mapping between multiplication factors and classifier. It can be used to evaluate new thresholds from a baseline by multiplying its standard deviation by the corresponding multiplication factor and adding the average .

Its value has exactly the same structure as Thresholds.

The threshold property can be only Decimal.

### Forecast

This type contains a list of forecasts at a specific time.

Each forecast value has the following properties:

 value integer, decimal or duration validTime the forecast instant when the value is valid

The value property can be Decimal, Duration or Integer.

Example of value
```{
"forecasts": [
{
"validTime": "2016-01-27T19:00:00",
"value": 1
},
{
"validTime": "2016-01-27T20:00:00",
"value": 2
},
{
"validTime": "2016-01-27T21:00:00",
"value": 3
}
]
}```

### Calendar configuration

This type is used to configure time frame for calendar period types.

Its value is composed of the following properties:

Property Description
timeZone The time zone that applies to ICS event (if not already specified)
rules An ordered list of period type configuration

Each period type configuration has the following properties:

Property Description
period The period type name
Example of value
```"calendarConfiguration": {
"timeZone": "Europe/Paris",
"rules": [
{
"period": "High",
"ics": "BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20170101T120000
DTEND:20170101T000000
RRULE:FREQ=DAILY
SEQUENCE:0
END:VEVENT
END:VCALENDAR"
},
{
"period": "Low",
"ics": "BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20170101T080000
DTEND:20170101T160000
RRULE:FREQ=DAILY
SEQUENCE:0
END:VEVENT
END:VCALENDAR"
}
]
}```