Modeling data

You can create your own data types and use them in your skills.

Data types can be used to:

  • Define diagram nodes in decision models and prediction models.
  • Write business rules and create decision tables in decision skills.
  • Create variables in ruleflow models and workflow skills.

Several prebuilt data types are available to you by default when you create a skill. Data types that are prebuilt for use within skills are called system types. The following table describes the system types available in your skills:

Table 1. List of supported system types
Data type Description
Boolean The logical values true or false
Document A reference to a document saved in the system
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
Integer A whole number, for example 15 or -8
Number A numeric value, for example 15 or -8.5
String A set of characters, for example "Hello world"
User An ID for a user in the system

If the system types are not suitable to represent the data you need to build your skill, you can also create custom data types. Two custom data types are available: composite types and choice lists. You can create custom data types in the Data tab.

Creating composite types

A composite is composed of one or more attributes. The attributes of a composite describe the characteristics of the real-world entity that it represents. Each attribute is associated with a data type.

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 type string
  • ID, of type number
  • car category, of type car category

Attributes can also be identified as a list. You use lists when your project acts on more than one item of something, and you need to make a distinction between the items. For example, if your project is about checking in baggage on a plane, you can identify baggage as a list, since more than one of piece of baggage may be checked in.

To create a composite type:

  1. Click the Add button Add next to Data types and select Composite type from the drop-down list.

  2. Enter a suitable name for the composite type.

    Tip: It is recommended to use a singular form for the type name.
  3. (Optional) Update the properties of the composite type:

Property Description
Documentation Provide some documentation to explain what your composite type is used for. The documentation is visible in the rule editor in decision skills.
JSON name Edit the JSON name associated with the data type. The JSON name is used when you preview or run your project.
Do not edit the JSON name of imported data types.
Vocabulary Edit the default verbalization of the composite type. For more information, see Verbalization.
  1. Add attributes:
    1. Click Add + in the Attributes panel.
    2. Enter a name for the attribute.
    3. Assign a type to the attribute.
    4. If applicable, check the List checkbox.
    5. Optional: Open the overflow menu next to the attribute and select Edit details and vocabulary to edit the properties of the attribute.

Creating choice lists

A choice list is a data type that consists of a set of pre-defined values. You must list each of this value and create a name for it. An example of a choice list might be the days of the week. Continuing the car example, you might create a choice list car category with its possible values: compact, full size, or premium.

To create a choice list:

  1. Click the Add button Add next to Data types and select Choice list from the drop-down list.

  2. Enter a suitable name for the choice list.

    Tip: It is recommended to use a singular form for the type name.
  3. (Optional) Update the properties of the choice list: add some documentation, edit its JSON name and default verbalization. For more information about each property, refer to the Creating composite types section above.

  4. Add values:

    1. Click Add + in the Values panel.
    2. Enter a name for the value.
    3. (Optional) Open the overflow menu next to the value and select Edit details and vocabulary to edit the properties of the value.

Verbalization

For each custom data type that you define, a default verbalization is applied. This default verbalization defines how these elements are referenced in business rules and decision tables in decision skills. The verbalization is not used in workflow skills.

The verbalization depends on the type of element, for example whether it is a system type or a composite type with several attributes. You can see examples of this default verbalization when you select a data type in the Data tab.

You can 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 that is associated with a composite type, for example {name} of {this}
  • An action modifies the data that is associated with a composite type, for example set the name of {this} to {name}

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

Also, 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.


Parent topic:

Building projects