Tag: llm

  • Pega tutorials-Create an external data source with REST integration in Pega

    Pega tutorials-Create an external data source with REST integration in Pega

    In this tutorial, we’ll walk through how to create an external data source in Pega, configure it using an external REST API, and finally use it to populate a dropdown in a case.


    1. Creating the Data Object

    To begin, go to:

    Data → New

    This opens the wizard for creating a new data object.

    Enter a name for your Data Object, then click Next.

    In the System of Record dropdown, select Create new, and enter a name for the new system of record.

    For this example, we will integrate with an external API that returns a list of countries.


    2. Defining the External Data Source

    Since we are retrieving information, we’ll use a GET method.

    Enter the endpoint URL for the external API.

    In this example, the service does not require headers or authentication, so we can simply click Initialize call to generate the structure.


    3. Selecting the Fields to Source

    The API response includes multiple details—country name, currency, languages, and more.
    You do not need to map all values. Instead, select only the properties you need.

    Click Add new and choose the specific fields that should be included in your data object.

    Environment Settings

    This section displays the Integration System Settings created automatically.
    These help manage different endpoints across development, staging, and production environments.


    4. Reviewing the Generated Data Type

    Open the data type you just created. You will notice:

    • The System of Record is set to External
    • The data source is the Get Countries API

    The wizard also automatically generates a Data Page in Page List mode.
    This Data Page is ready to be used as the source for:

    • Dropdowns
    • Autocomplete fields
    • Any UI component requiring country data

    5. Reviewing the Generated Data Page

    The Data Page is already configured with:

    • The Connector
    • The Response Data Transform

    Since the API does not require parameters, no Request Data Transform is needed.

    Click Run to test the Data Page.
    This confirms:

    • The API connection is successful
    • The response mapping works correctly
    • All returned data is visible under pxResults

    You should now see a list of all countries retrieved from the API.


    6. Using the Data Page in a Dropdown

    Next, let’s use the Data Page as the source for a dropdown field.

    In your case or UI section:

    1. Select Field type: Data Page
    2. Enter the Data Page name created by the wizard
    3. Set the parameter value to countries (or the name used in your Data Page)
    4. For the Property value, select Alpha Code
    5. For the Display text, select Name

    Click Save, and then run a case to verify that the dropdown loads correctly.

    Open the dropdown and choose any country.
    Check the Clipboard to confirm the selected country is saved properly.


    This completes the process of creating and using an external data source in Pega—from configuring the API to integrating it into your UI. If you have any questions or run into issues, feel free to ask!

  • SOAP Integration in Pega from scratch

    SOAP Integration in Pega from scratch

    1. Launching the SOAP Integration Wizard

    In Dev Studio, go to:

    Configure → Integration → Create SOAP Integration

    This opens the SOAP Integration Wizard.

    The first step is to provide a WSDL URL, which defines the structure of the web service.
    For this example, we will use:

    http://www.dneonline.com/calculator.asmx?WSDL

    Click Next to continue.


    2. Reviewing Service Metadata

    After loading the WSDL, the wizard displays:

    • Service name
    • Port name
    • Endpoint
    • Available operations

    You can test operations from this screen. Once testing is done, click Next.


    3. Integration Layer Configuration

    The wizard now shows:

    • The integration class
    • The ruleset
    • The context where the integration assets will be created

    Click Preview Records to see all rules the wizard will generate. This modal displays the rule types and quantities.

    When clicking Create, you may encounter an error. This happens because Pega sometimes does not automatically create the integration class for SOAP services.

    If this occurs, manually create the class where all integration assets will be stored. After creating the class, click Create again.

    This time, the SOAP connector will be successfully generated.

    You’ll see:

    • Class name
    • Ruleset
    • WSDL
    • All created data sources
    • Option to Undo Generation, which removes all generated rules if needed

    Click Close when finished.


    4. Reviewing the Generated Connector

    Navigate to the integration class:

    App Class → Calculator → Integration-Connectors → Connect SOAP

    Here you’ll find one connector rule per operation defined in the WSDL.

    Inside each connector you can verify:

    • Endpoint details
    • Error handling
    • Processing options
    • Simulation settings

    Connector Request & Response

    Under the Request tab, you’ll find:

    • SOAP headers (if any)
    • Request parameters
    • The XML Stream rule (e.g., AddParameters) responsible for request mapping

    The Response tab includes the same structure for mapping outputs.


    5. Creating the Data Page

    Next, create a data class to hold the response from the service.
    Then create a Data Page that will invoke the SOAP connector.

    Configuration:

    • Source type: Connector
    • Connector type: SOAP
    • Connector name: Add (for this example)

    You can try the other operations later as practice—feel free to leave a comment if you have issues.


    6. Request Data Transform

    Create a Request Data Transform that passes two parameters:

    • intA
    • intB

    Make sure these parameters exist both in the Data Page and in the Data Transform.

    Map the two variables to the fields expected by the SOAP service.


    7. Response Data Transform

    Pega automatically generates a boilerplate Response Data Transform, but you can customize it.

    Important note:
    If the connector response returns a page, you must create the corresponding property in your data class and map the values one-to-one.
    If your data page runs successfully but the response appears empty, it’s usually because this mapping step was missed.


    8. Testing the Integration

    To test the integration:

    1. Open the connector rule
    2. Scroll to the bottom
    3. Click Test Connectivity

    If the service fails, Pega will show the error details.

    To test the Data Page:

    1. Open the Data Page
    2. Click Actions → Run
    3. Enter parameters (intA and intB)
    4. Validate the results and response status

    If any errors occur, they will appear in the results panel.


    Summary — Complete Integration Steps

    1. Obtain the WSDL
      Example: http://www.dneonline.com/calculator.asmx?WSDL
    2. Validate required headers or authentication (Postman helps with this).
    3. Go to
      Configure → Integration → Create SOAP Integration
      and follow the wizard.
    4. Verify generated classes and rules.
    5. Test connectivity in the connector.
    6. Create:
      • Data class
      • Data Page
      • Request Data Transform
      • Response Data Transform
      • Any needed properties
    7. Map request and response values.
    8. Run the Data Page and validate that the service works end-to-end.

    You can watch the full step-by-step demonstration in the accompanying video.
    Feel free to leave questions or comments—happy integrating!