Modeling data in Automation Decision Services

You use the data model editor to define the data you need to make your decision.

A data model is a collection of data types that represents the data you need to feed your decision. In this data model, you use built-in data types and custom data types as building blocks to model the structure of the real-life data that you want to represent.

For example, in a decision that computes the discount rate to apply to the purchases of a loyal customer, you would create a data model that represents the customer details and the content of its shopping cart.

The data types that you define in a data model are used to assign a type to each input data node and decision node in your decision models. Assigning a type to a node determines:
  • What information the node can store and send.
  • The possibilities when authoring the decision logic.

You create your data model from the Data and libraries tab inside a decision service. You can create only one data model in a decision service.

Data types

Each term that you define in a data model is associated to a data type. This data type can either be a built-in type, or a custom type.

Automation Decision Services supports the following built-in data types:

Table 1. List of supported built-in data types in Automation Decision Services
Data type Description
Boolean The logical values true or false
calendar duration A duration expressed by units of time, for example P6M10D for a period of 6 months and 10 days
date A specific calendar date, for example 01/01/2019
date & time The combination of date and time, for example 01/01/2019 12:30:00
day of week A day of the week
integer A whole number, for example 15 or -8
month A month of the year, for example January
number A numeric value, for example 15 or -8.5
string A set of characters, for example "Hello world"
time A specific time value, for example 12:30:00
time period A specific time period that is characterized by a start time and an end time, for example 2019-07-14T01:01:01Z/2019-07-15T01:01:01Z
year A year, for example 2019
Two custom types are available in Automation Decision Services:
Composite type

A composite type is a composite of other existing data types. You might create a composite type whose attributes include built-in types, or other custom types. The attributes of a composite type describe the characteristics of the real-world entity that it represents.

A car, for example, can be characterized by its brand, its ID, and its category. To represent it, you can create a composite type car that contains the following attributes:
  • brand, of built-in type string
  • ID, of built-in type number
  • car category, of custom type car category

For more information about composite types, see Working with composite types.

Enumeration type

An enumeration type is a data type that contains a specific set of values. The data that the enumeration represents can only take a value from this list.

The custom type car category, for example, can be described as an enumeration that can only take one the three following values: compact, full size, or premium.

For more information about enumeration types, see Working with enumeration types.

Automation Decision Services also allows you to enrich your data model with custom data types and functions from imported external libraries. For more information about building and importing external libraries, see Working with external libraries.

Verbalization

For each element that you define in the data model, Automation Decision Services applies a default verbalization. This default verbalization defines how these elements are referenced in business rules and decision tables.

The verbalization depends on the type of element, for example whether it is a simple type or a composite type with several attributes. You can see examples of this default verbalization in the data model editor when you open the details of an element. For more information about the default verbalization that is applied to attributes, see Default verbalization.

Automation Decision Services allows you to edit the default verbalization directly in the data model editor.

Each attribute comes with a set of automatically generated expression and action phrases:
  • An expression accesses the data associated with a composite type, for example {name} of {this}
  • An action modifies the data associated with a composite type, for example set the name of {this} to {name}

You might want to edit the default verbalization of expression and action phrases to make them easier to understand or avoid wordiness.

Additionally, each data type and attribute that you define has an associated plural form and a list of associated articles in both its singular and plural forms:
  • A definite and an indefinite article for both data types and attributes
  • A quantitative article for data types only

You can change this default verbalization to specify, for example, the plural of a term that has an irregular form.

JSON name

Each element that you define in a data model has an associated JSON name. This JSON name is used when validating or executing a decision service. Each data type must have a unique JSON name. Each attribute must have a unique JSON name within its enclosing data type.

The JSON name is derived directly from the element name, but uses the camel case convention. The JSON name can be edited.

Restriction: Spaces are not allowed in JSON names if you want to publish your decision service as an automation service.