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.

To define a custom data type:

  1. Click the Types icon Types icon to open the Type Definition pane.
  2. In the Type Definition pane, click Add New Type.

    In the resulting New Type pane that opens for editing, you see that a new type definition is created with a default name.

  3. In the New Type pane:
    1. Edit the default name in the Name field, 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 Make a list 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 type attribute icon to add a new attribute. The New Type Attribute pane opens and an attribute is created with a default name.
      2. In the pane, edit the attribute's name, select the mode, and enter allowed values or a range for the attribute.
      3. Select the Make a list check box to identify the attribute as a list.
      4. Click Close Close icon to return to the Type Definition pane, and repeat steps i-iii to add another attribute to the complex type definition.
      5. Click on any type attribute to modify the type attribute.
      6. To delete a type attribute, click the row and then click Delete Delete icon.

    Description of new-type-complex.png follows
    Description of the illustration new-type-complex.png

  4. Now select the input data element on the canvas for which you want to use the custom variable type.
  5. Double click the element, or click Open Properties to open the Input Properties pane.
  6. From the Mode drop-down list, select Other Type.
  7. In the resulting Other Type drop-down list, select the type definition you just created.
  8. Click Close Close icon to save the changes and close the Input Properties pane.

Create Custom Data Types in Decision Applications

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.

While creating a decision application, you can define a custom data type in one of the following ways:

  • Manually define each custom data type.
  • Import a JSON file or schema containing the custom data types.

Limitations of Importing a JSON Schema

The following are the limitations of importing a JSON schema:

  • The maximum size of the JSON schema that you can import is 200 KB.
  • The JSON schema must not have fields that exceed 20 levels of nesting.
  • In the JSON schema, data is extracted to create types from the following keywords:
    • type
    • format
    • items
    • enum
    • definitions
    • properties
    • $ref

    Hence, Process Automation does not support keywords that are not included in this list. For example, anyOf, allOf, oneOf, pattern, required, minLength, maxLength, and regex.

  • Field names in the schema must:
    • Start with a letter, underscore, or colon.
    • Contain only letters, digits, underscores, hyphens, or periods.

To import a JSON file for creating custom data types in decision applications:

  1. In the decision application, click the Types icon Types icon to open the Type Definition pane.
  2. In the Type pane, click
    Import JSON file or schema

    .

    A drop-down appears and shows the options Import from sample and Import from schema.

  3. Select one the following options:
    • To import a JSON sample, select Import from sample.
    • To import a JSON schema, select Import from schema.
  4. On the Create new type pane, in the Name field, enter the name for the custom data type.
  5. If you have selected Import from sample, the Sample tab appears where you paste the JSON sample containing the data types. Click Next to view the schema created. If there are no changes required, click Create.
  6. If you have selected Import from schema, the Schema tab appears where you paste the JSON schema containing the data types. Click Create to create custom data type.