Define Custom Data Types

If built-in data types aren’t suitable for an input variable in your decision model, you can create a custom data type.

A custom data type can be a new complex data type or an alias of a built-in data type. Further, to create a complex data type, you can use a combination of built-in data types or other complex data types.

Define Custom Data Types in Graph View

  1. Select the input data element on the canvas for which you intend to define and use a variable of custom data type.
  2. Click Open Properties Open Properties icon.
  3. In the properties pane:
    1. Select the Mode as Other Type.
    2. Now, click the Define New Type link that appears in the pane.

      A new type definition is created with a default name and the Add Type Definition panel opens for editing.

  4. In the type definition panel:
    1. Edit the definition's name if necessary.
    2. Select the Mode (that is, the data type) for the definition. You can select one of the built-in data types to create aliases or choose to define a complex data type.
    3. To identify the data type as a list, select the isList? check box.
    4. If you select the mode as Text, Number, or Date and Time, you can optionally define allowed values to restrict the data type definition to enumerated values or ranges.
    5. If you select the mode as Complex, define attributes within the type definition.
      1. Click Add Component Add Input Variable icon to add a new attribute. An attribute is created with a default name and the Add Component panel opens for editing.
      2. In the panel, edit the attribute's name, select the mode, and enter allowed values or a range for the attribute.
      3. Select the isList? check box to identify the attribute as a list.
      4. Click Close Close icon to return to the Add Type Definition panel, and repeat steps i-iii to add another attribute to the complex type definition.
      5. Use Edit or Delete buttons to modify the attributes.
    6. Click Close Close icon to save and close the type definition panel. The following image shows an example definition:

    Description of dmn-data-type.png follows
    Description of the illustration dmn-data-type.png

  5. In the Input Data Properties pane, choose the type definition you just defined in the Other Types field to associate it with your input data variable. You can edit or delete the type definition using the buttons next to the field.

    You can also use this new type definition to create variables in other input data elements within the model.

Define Custom Data Types in List View

  1. In the Type Definition section of the Input Data pane, click Add new item definition Add Item Definition icon. A new type definition is created with a default name and the Add Type Definition panel opens for editing.
  2. Edit the type definition's name if necessary.
  3. Select the Mode (that is, the data type) for the definition. You can select one of the built-in data types to create aliases or choose to define a complex data type.
  4. To identify the data type as a list, select the isList? check box.
  5. If you select the mode as Text, Number, or Date and Time, you can optionally define allowed values to restrict the data type definition to enumerated values or ranges.
  6. If you select the mode as Complex, define attributes within the type definition.
    1. Click Add Component Add Component icon to add a new attribute. An attribute is created with a default name and the Add Component panel opens for editing.
    2. In the panel, edit the attribute's name, select the mode, and enter allowed values or a range for the attribute.
    3. Select the isList? check box to identify the attribute as a list.
    4. Click Close to return to the Add Type Definition panel, and repeat steps a-c to add another attribute to the Complex type definition.
    5. Use Edit or Delete buttons to modify the attributes.
  7. Click Close to save the data type definition. You can edit or delete a type definition using the Menu Menu icon.