Modeling Guide for SAP Data Hub

Create Types

Types are JSON files that enable you to define properties and bind them with data types. You can also associate the properties with certain validations, define its UI behavior, and more.

Context

Types are based on JSON schema. The Modeler application provides a form-based UI to create types. After creating a type, you can reuse them, for example, in the type definition to define the operator configurations or of specific parameters within the operator configuration definition.

The application also provides global types, which are associated with the configuration parameters of certain default operators (base operators) available within the application. If you want to access the global types, in the navigation pane, choose the Types tab.

Procedure

  1. Start the SAP Data Hub Modeler.
  2. In the navigation pane, choose the Types tab.
  3. In the navigation pane toolbar, choose + (Create Type).
    The application opens an empty type editor in a separate tab, where you can define the type.
  4. In the Description text field, provide a description for the type.
  5. Create a property.
    1. In the Properties pane, choose + (Add property).
      Types can have more than one property.
    2. In the Name text field, provide a name for the type property.
    3. In the Title text field, provide a name for the property.
      The application uses the value in the Title as the display name for the property in the UI.
    4. In the Description text field, provide a description for the property.
  6. Define the property.
    You can define the data type, UI behavior, and UI validations for the property.
    1. In the Data Type dropdown list, select the required data type value.

      Value

      Description

      String

      For properties of data type string, you can define helpers. These helpers enable you to identify the property type and define values accordingly. In the Validation dropdown list, select a value. The application format, predefined values, and services as helpers.

      • In the Format dropdown list, select the required format.

        The application supports the formats, date and time, URL, password, or e-mail for properties of data type string.

      • In the Value Help dropdown list, select a value.

        Predefined Values: You can preconfigure the property with a list of values that users can choose from the UI. The application displays the property in the UI as a dropdown list of values. In the Values text field, provide a list of values.

        Service: You can specify a URL to obtain the property values from the REST API. The application displays the response from the service call as auto-suggestions to users. In the Url text field, specify the service URL.The response from the REST API can be an array of strings or an array of objects. If the response is an array of objects, in the Value Path field, provide the name of an object property. The application renders the values of this object property in a dropdown list in the UI to define the operator configuration.

      Object

      For properties of data type object, the application lets specify the schema of the object by drilling down into the object definition. In the Properties section, double-click the property to drilldown further and define the object schema.

      Array

      For properties of data type array, you can specify the data types of items in the array. In the Item Type dropdown list, select a value. The application supports string, number, object, and custom as data types for array items.

      If the Item Type is Object, in the Properties section, double-click the property to drilldown further and define the object schema.

      If the Item Type is Custom, select and reuse any of the predefined types for the property definition.

      Number

      For properties of data type number, you can provide numbered values to the property.

      Boolean

      For properties of data type Boolean, you can provide Boolean values to the property.

      Integer

      For properties data type integer, you can provide integer values to the property.

      Custom Type

      Custom data types enable you to set the data type of a property to another user-defined type. In the Type dropdown list, select a value. The application populates the dropdown list with the global schema types.

    2. If you want to configure the property to mandatorily accept values, enable the Required toggle button.
      If enabled, users must mandatorily provide values to the property in the UI. The property value cannot be empty.
    3. If you want to configure the property as read-only, enable the ReadOnly toggle button.
      If enabled, the application does not allow any edits to the property from the UI.
  7. (Optional) Control property visibility.
    You can choose to configure a property as Visible or Hidden in the UI. Additionally, you can also define one or more conditions to control the visibility based on the values of other properties.
    1. If you want to display the property in the UI based on certain conditions, select Conditional.
    2. Define the required property and value pairs.
    3. If you want to define another condition, choose + (Add dependency).
    The application performs AND operation of all conditions to determine whether the property should be Visible or Hidden in the UI.
  8. Save type.
    1. After creating a type, in the editor toolbar, choose (Save) to save the type definition.
    2. Choose the Save menu option.
    3. Provide a name along with the fully qualified path to the type.
      For example, com.sap.others.<typename>.
    4. Choose OK.
      The types are stored in a folder structure within the Modeler repository. For example, com.sap.others.typename. If you want to save another instance of the type, in the editor toolbar, choose (Save As). Provide a name along with the fully qualified path to the type.