Connect-REST is an advanced mechanism in Pega that provides developers with a way to interact with external REST services that return data in XML or JSON format. The process involves the following steps:
1. Creating a Connect-REST service: Using the Connect-REST rule wizard, developers can set up basic services that can be used to send and receive data from a REST web service. This includes specifying the HTTP verb, the request URI, the request parameters, the request headers and the response media type. 2. Configuring the Connect-REST rule: The Connect-REST rule is used to configure its respective REST service, and it contains all the relevant logic for setting up how to ship and receive the request data. Here, business rules can be defined to format the requests, responses and parameter mappings. 3. Consumption of Connect-REST from activities: To invoke the Connect-REST service from an activity, it needs to be provided with an appropriate Connector and Web Service Access shape. 4. Invoking Connect-REST from Smart Bases or Flows: Smart Bases and flows can also consume Connect-REST services, but here the developers need to explicitly configure the appropriate Connector and Web Service Access shape.step by step process Connect-REST in Pega
1. Add the Connect-REST palette to an application and create a new rule using the "Connect-REST" rule type.
2. Configure the Service URL, HTTP Method and Content Type.
3. Select the headers and body content you need for the request configuration.
4. Create rules for response handling such as a Mapping for Leveraged/Outbound parameters, a Parse as HTML rule for HTML data and a JSON-Jar for JSON response data.
5. Test the configuration using the Test Connect-REST and review the results.
6. Use the Connect-REST rule in other rules and activities.
7. Publish the changes.
1. Log in to Pega platform and navigate to the Dev Studio view.
2. Select the rule which will invoke the connection you want to set up from the Rule Set and open the Connect-REST rule form.
3. Enter a meaningful Connect-REST Rule Name as per your requirement.
4. Select whether your connect-REST transaction involves a request and/or a response.
5. Under the Endpoint Mapping tab, enter the URL of the Service Point you want to call.
6. Select the HTTP Method - GET, POST, PUT or DELETE - to invoke the Service Point.
7. Under the Request Data tab, identify the Request data fields that you want to send along with the request.
8. Under the Response Mapping tab, specify how the data in the response body needs to be mapped against the Response Page.
9. Under the Advanced Settings tab, specify your custom security settings if applicable.
10. Once all settings are defined, click the Save button to save the Connect-REST rule.
11. Finally, invoke the Connect-REST rule either directly or as part of an activity or a data transform.
No comments:
Post a Comment