Adding a data type for remotely stored data by using REST

Data types can be referenced from cases. For example, you can add a data type and all its fields to a form when you click Configure view for a step.

When you create a data type by using REST, the following artifacts are created:
  • A data type that is a class rule
  • The data model for the data type
  • A REST connector
  • A data page

To add data types to your application, perform the following steps:

  1. In your application, click Turn editing on.
  2. To view the list of current data types in your application, in the navigation panel, click Data.
  3. To start the data type wizard, click New > Connect via REST.
  4. In the Create data type field, enter a short name for your data type that indicates the type of data that the data type will manage, for example, customer.
  5. Optional: To reuse assets from another data type, click Advanced, and select a data type.
  6. Click Continue.
  7. In the Source name field, enter a descriptive name for the source.
  8. For the GET method, in the Endpoint URL field, enter the endpoint URL of the data.
    Note: Heterogeneous JSON structures are not supported in Pega Express. Even though rule generation shows as successful, runtime execution fails. Use Designer Studio for heterogeneous JSON structures.
  9. Optional: In the Parameters section, choose which parts of the URL are dynamic and need to be parameterized for future calls.
    • Click the URL part that you want to parameterize.
    • In the Parameter name field, enter the name.
  10. Optional: In the Headers section, specify request headers and their values.
  11. Optional: In the Authentication section, select basic or NTLM authentication, and specify the user name, password, realm, or domain to use for authentication.
  12. Click Initialize call to connect to the REST service and return the JSON response.
  13. Optional: Click the Information icon to view the raw response data.
  14. Select the fields that you want to keep.
    • Click Add all to keep all the fields.
    • Click Add new next to a field that you want to add. Map the field to a different field by entering the field name in the Map to field, and select the data type.
  15. Click a field name to change its mapping. In the Map to field, enter the field name to map to and select the data type.
  16. Click Submit.