Creating composite types

A composite data type is composed of a name and a list of attributes that describe the characteristics of an object. It lets you regroup related data under one entity.

About this task

In the following example, you see a composite type called customer with its associated attributes:
Composite type customer with its associated attributes name, address, date of birth, and customer category

Attributes can be built-in data types or other custom data types.

Attributes can also be identified as a list. You use lists when your decision acts on more than one item of something, and you need to make a distinction between the items. For example, if your decision 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.

Procedure

  1. Click the Add button Add data type button next to Data types and select Composite type from the drop-down list.
  2. Enter a suitable name for the composite type. It is recommended to use a singular form for the type name.
  3. If necessary, you can update the details of the composite type.
    • Define a documentation property using the Documentation text field. This documentation will be visible in the prediction menu in the rule editor.
    • Edit the JSON name associated with the composite type.
    • Change the plural form or the articles associated with the composite type. To do so, click the placeholder for the article or plural form that you want to edit and edit it directly in the pop-up window that opens. You can revert to the default verbalization by clicking Reset.
    • Select the gender of the composite type if your decision service is in French. The masculine gender is applied by default.
  4. Click the Add button Add data type button in the Attributes panel.
  5. Enter a suitable name for the attribute. It is recommended to use a singular form for the attribute name.
  6. Associate the attribute with a data type that you select from the Type drop-down list.
  7. If necessary, edit the details of the attribute. To access the full details of the attribute, click the Edit button Edit button next to the attribute, or click the attribute in the Data types panel.
    • Define a documentation property using the Documentation text field. This documentation will be visible in the prediction menu in the rule editor.
    • Edit the JSON name associated with the attribute.
    • Change the plural form or the articles associated with the attribute. To do so, click the placeholder for the article or plural form that you want to edit and edit it directly in the pop-up window that opens. You can revert to the default verbalization by clicking Reset.
    • Edit the default verbalization of expressions and actions associated with the attribute. For more information about the default verbalization applied to attributes, see Default verbalization.
    • Identify the attribute as a list by checking List. When an attribute is identified as a list, it can have multiple values.
    • Select the gender of the attribute if your decision service is in French. The masculine gender is applied by default.
  8. Repeat for each attribute of the composite type.