Creating the connection and setting up the class structure for a new Contact entity
Set up the REST connection. The REST wizard automatically creates request or response data transforms based on the mapping that was provided in the information or metadata from the service.
- On the Data objects and integrations page, click New in the top right corner.
- In the Create new data model field, enter the name of your data model, for example, ContactEntity1.
- Click the Advanced tab. In the Reuse assets
from field, select Implementation data
class.
- In the System field, select Create new.
- In the Name field, enter the name of the system that you want to connect it, for example, a bank’s system of record (SOR) for contacts.
- In the Description field, enter a description, for example the purpose of the connector, such as or retrieving search results based on search text.
- To change the icon to reflect the service provider, click Change and select one of the icons.
- In the Connection details section (based on the
information in the service provider’s Swagger file), in the
Method field, select either GET or POST as the
connection method, and then enter a value in the Endpoint
URL field for the REST connection. Based on the contact ID entered, Pega Customer Service creates the integration layer, the data layer which consists of the data class, attributes, data pages, and request and response data transforms. Pega directly maps JSON data to the application data layer in the response data transform.
- In the Parameters section, choose which part of the URL is
dynamic and needs to be parameterized for future calls, for example,
ContactID-1003.You need to provide a sample request or response in order that the connection wizard creates the required assets.
- In the Headers section, click Add header to specify a request header and its value. Some services require extra information, for example, API version.
- Click the Authentication tab. Configure authentication for your system of record, based on the type of authentication that you choose.
For more information, see Authenticating with basic or NTLM authentication or Authenticating with OAuth 2.0.
- Click Initialize call. Pega Customer Service automatically creates the response mapping data transform for the response structure. Based on the response, the wizard displays errors, if any, or prompts with the sample response.
Mapping fields for the GET method when creating a data object
On the Data mapping page, select the data that your application needs for processing by mapping fields from the REST response to the data objects.
The connector parameters are on the left and the data page parameters are on the right.
- To use data from your system of record, click the Live response radio button.
- Select the fields that you want to include in the data object and map them to
your data view by using the options in the list below. You might select the
Add all link at the top right side of the page, and
then remove the ones that you do not want.
- To add the field to the data object, click Add new. You can change the field name and its type.
- To add all the fields from the REST response to the data object by using the same field names, click Add all. To change the name and the data object, click on the name. To remove a field mapping, click on the name and click the Delete icon.
- To remove all the fields from the data object, click Clear all.
- Click Next.
- Edit the fields if needed. For more information, see Preparing your data for production.
- Click Submit.
- Click Save. The REST wizard creates the connector, the response data transform, the data page, and new properties, if needed, in App Studio.
On the Data model tab, you can see that the contact entity has been created and that all the properties that are from the external system. You can also see the application layer where the properties are being used.
When you click Data Views, you can see the data page.
In the More menu, you can replace the source, update the source, and update environment settings.
- In the More menu, click Open in Dev Studio
to view the data page.
Changing the parent class on the D_ContactEntity data page
You need to change the parent class listed on the D_ContactEntity data page to a Customer Service class so that the system reuses the assets from customer service.
- In Dev Studio, on the Definitions tab of the data page, copy the class name in the Object type field, for example, MyCo-Loan-Data-ContactEntity1.
- In the navigation panel, click App, and then search for the class name of the contact entity.
- Right-click the class name, and then select Definition.
- On the Edit Class page (General
tab), in the Parent class field of the Class
inheritance section, click and enter the Pega Customer Service
contact class, for example, PegaCA-Interface-Contact.
- Click Save.
Modifying the D_Contact_Details data page
D_Contact_Details is a Pega Customer Service out-of-the-box data page. It has an activity as the source which reads the information locally. You want to change this data page so that it communicates with the service, and you can retrieve data from the external system.
- In Dev Studio, search for the D_Contact_Details data page.
- Open the D_ContactEntity data page that was created for
this case, and then save it as D_Contact_Details data page
in the application. The object type, source, connector, and mapping data transforms are updated.
- To ensure that the data page is working correctly and is retrieving information from the external system, click to test a contact ID, for example, CONT-1004.
Previous topic Creating a new application Next topic Configuring user portals