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:
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 stringID
, of type numbercar 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:
-
Click the Add button next to Data types and select Composite type from the drop-down list.
-
Enter a suitable name for the composite type.
Tip: It is recommended to use a singular form for the type name. -
(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. |
- Add attributes:
- Click Add + in the Attributes panel.
- Enter a name for the attribute.
- Assign a type to the attribute.
- If applicable, check the List checkbox.
- 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:
-
Click the Add button next to Data types and select Choice list from the drop-down list.
-
Enter a suitable name for the choice list.
Tip: It is recommended to use a singular form for the type name. -
(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.
-
Add values:
- Click Add + in the Values panel.
- Enter a name for the value.
- (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: