Creating a request for GET and DELETE methods by using an automation implementation
Create a request for your service so that you can define an external API over REST that customers can call for their application. To create the request, select an automation, and map the request headers, resource path parameters, and query string parameters to the inputs of the automation.
Before you begin: Create a Service REST rule and configure the resource and
processing details. For more information, see Creating a Service REST rule and Defining resource and processing details for a Service REST rule.
Note: The ability to create automations is restricted in Pega Platform
8.4. You can take advantage of this capability in an upcoming Pega Platform release.
- In your Service REST rule, click the Methods tab, and then click the method for which you want to create the request body.
-
In the Implementation section, select
Automation.
Note: If you map to an automation input on the Service tab of your Service REST rule, you must choose Automation as your implementation.
-
In the Automation field, press the Down arrow key and
select an automation from the list.
Result: The inputs, outputs, and errors associated with the automation are displayed.
-
In the Inputs section, in the Value
fields, enter or select a constant value for the corresponding inputs.
Note: If you map the input to a piece of the request, the Value fields no longer appear. You can provide a constant value or map the input to a piece of the request. Additionally, for required inputs, you must specify a constant value or map the input to a piece of the request in order to save the rule.
-
If you selected Enable service SLA with fallback
activity on the Service tab of your
Service REST rule, in the Fallback activity name field,
select or enter a fallback activity to call during a time-out.
For more information, see Defining resource and processing details for a Service REST rule.
- If the activity you selected in step 5 has parameters, in the Parameters section, enter values for the parameters for the fallback activity.
-
On the Request tab, in the Headers
section, configure the header information:
- In the Name field, enter the external name of the header field.
- In the Description field, describe the purpose of the header.
-
In the Map to field, specify the destination or
the type of destination for the value in Pega Platform:
- Automation input – Map to an available
input specified by the Map to key field.
Note: If you select a page type input, you must select a scalar property within that page by using the Field within page input option in step 7e. You cannot map a header to a page or page list directly. Additionally, if you map to a date field or input, the expected format for the date value is Pega API format.
- Clipboard – Map to the page name or property on the clipboard specified by the Map to key field, or map to a parameter by specifying param.<some param name>.
- MapTo functions – If additional choices
appear, they identify a custom function rule
(Rule-Utility-Function rule type) in a
MapTo
library. Review the function rule to determine what it does.
- Automation input – Map to an available
input specified by the Map to key field.
-
In the Map to key field, specify the key to
locating the property or the rule in the destination specified in the
Map to field:
- If the Map to value is Clipboard, enter the property name to which to map the data at run time. You can also map to a parameter by specifying param.<some param name>.
- If the Map to value is a
Rule-Utility-Function from a
MapTo
library, either select a property to hold the results of the function, or leave this field blank, as appropriate for the function. - If the Map to value is Automation input, select an input from the list of available inputs.
- If you specify a page type input in step 7d, in the Field within page input field, select a scalar property to use within that page.
-
If you mapped to an automation input on the Service tab
of your REST service, in the Resource path parameters
section, in the Map to key field, press the Down arrow
key to select an input.
- If you specify a page type input, in the Field within page input field, select a scalar property to use within that page.
Note: If you mapped to the clipboard on the Service tab of your REST service, the Resource path parameters section is read-only. All methods share the resource path parameters that you configure on the Service tab of your REST service. Resource path parameters are part of the request process of every method. For more information, see Defining resource and processing details for a Service REST rule. -
In the Query string section, enter the query string
parameters:
- In the Name field, enter the name of the input query string.
- In the Description field, describe the purpose of the query string.
-
In the Map to field, specify the destination or
the type of destination for the value in Pega Platform:
- Automation input – Map to an available
input specified by the Map to key field.
Note: If you select a page type input, you must select a scalar property within that page by using the Field within page input option in step 9e.
- Clipboard – Map to the page name or property on the clipboard specified by the Map to key field. You can also map to a parameter by specifying param.<some param name>.
- MapTo functions – If additional choices
appear, they identify a custom function rule
(Rule-Utility-Function rule type) in a
MapTo
library. Review the function rule to determine what it does.
- Automation input – Map to an available
input specified by the Map to key field.
-
In the Map to key field, specify the key to
locating the property or the rule in the destination that is specified
in the Map to field:
- If the Map to value is Clipboard, enter the property name to which the data should be mapped at run time. You can also map to a parameter by specifying param.<some param name>.
- If the Map to value is Automation input, select an input from the list of available inputs.
- If the Map to value is a
Rule-Utility-Function from a
MapTo
library, either select a property to hold the results of the function or leave this field blank, as appropriate for the function.
- If you specify a page type input in step 9d, in the Field within page input field, select a scalar property to use within that page.
- Click Save.