Modeling Guide for SAP Data Hub

Create Types

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

Context

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

The tool also provides global types, which are associated with the configuration parameters of certain default operators (base operators) available within the tool. 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 tool 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 tool uses the Title text field value as the display name (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 validations.
    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 users to easily identify and define the property values. In the Validation dropdown list, select a value. The tool provides format, predefined values, and services as helpers.

      • Format: You can choose from any of the supported formats such as date and time, URI, password, or e-mail.
      • Predefined Values: You can preconfigure the property with list of values for users to choose. The property will be displayed to users as a dropdown list of values. In the Value field, provide the list of values.
      • Service: You can specify a URL to obtain the property values from the REST API. The tool displays the response from the service call as auto suggestions for the users. In the Url text field, specify the service URL.

        The response from the REST API can be an array of strings or array of objects. If the response is array of objects, in the Value Path field, provide the name of an object property. The tool 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, you can 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 tool 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, you can select and reuse one of the predefined types for the property definition.

      Number

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

      Boolean

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

      Integer

      For properties data type integer, users 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 tool populates the dropdown list with the global schema types.

    2. If want to set the property as mandatory, enable the Required toggle button.
      If enabled, users must mandatorily provide values to the property. The property value cannot be empty.
  7. (Optional) Control the property visibility.
    You can control the visibility of the property in the UI based on values of other properties. You can define more than one condition to control the visibility.
    1. If you want to display the property in the UI based on values of other properties, set the UI Conditions toggle button to True.
    2. In the Visiblity text field, select a property that you want to use to define the condition.
    3. In the Value field, provide a value.
    4. If you want to define another condition, choose + (Add dependency).
    The tool performs AND operation of all conditions to determine whether the property should be visible or hidden on 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.