Use the Service tab of the Service REST rule to configure the mapping of the URL path parameters, data transforms, and other configuration options for your service.
- On the Service tab of your Service REST rule, configure the page
class or the resource depending on which Pega Platform version you are
Pega Platform version Actions Pega Platform versions later than 8.4 In the Resource properties section, in the Resource field, enter the class of the primary page for this service. Pega Platform versions prior to 8.4
- In the Primary page section, in the Page class field, enter the class of the primary page for this service.
- In the Data transform field, specify a data transform to run on the service page before processing the request. Use this option to set defaults on the page.
- In the Page name field, enter a name for the page so
that you can reference it from other rules. If you leave this field blank, a
page name is automatically generated.
- In the Resource properties section, specify the URI path
- In the Name field, enter the name of the variable resource parameter in the resource path.
- In the Description field, enter a description for the variable resource parameter.
- In the Map to field, select the destination or the type of
destination for the value in Pega Platform.
- Clipboard – Map to the page name or a property on the clipboard specified by the Map to key field.
- Automation input – Use an automation to implement the method. If you select this option for any resource path parameters, you must use an automation as your implementation for each method that you implement in your rule.
- In the Map to key field, specify the key used to locate the
property or the rule in the destination that you specify in the Map
- If the Map to value is Clipboard, enter the property name to which to map the data at run time.
- If the Map to value is Automation input, this field is not editable. You specify the Map to key values on the Request tab of the method that you want to implement.
- In the Processing options section, specify the following
- End Requestor When Done – When the Processing mode field on the service package is set to Stateful, you can select this option to have the system end the requestor after the activity ends and the response is sent. If the services are stateless, the value in this field is ignored. For more information, see Defining processing and authentication for service packages.
- Method is read-only – You can select this option to indicate that each use of this service does not count as a service invocation under the terms of your license agreement. For more information, see License compliance.
- Enable service SLA with fallback activity – You can select
this option to configure a fallback activity for a time-out. For example, when the service activity is
not finished after a configured amount of time and the maximum number of violations has
occurred, the fallback activity is called. No further requests are attempted until the
retry interval has passed. If the next attempt is successful, normal processing is
If you select Enable service SLA with fallback activity, the following options are displayed:
- Maximum duration for service activity (milliseconds) – Enter the amount of time, in milliseconds, after which the service activity is considered to have failed. The default is 500 milliseconds.
- Maximum consecutive violations – Enter the number of SLA violations that must occur before the fallback activity is called. The default is 3.
- Retry interval (seconds) – Enter the amount of time, in seconds, to wait before attempting to process the service activity. The default is 10 seconds.
- Optional: If you select Enable service SLA with fallback activity, you can
choose the method for setting the values in the Maximum duration for service
activity (milliseconds), Maximum consecutive
violations, and Retry internal (seconds)
- Provide values – Select this option to manually enter values in the Maximum duration for service activity (milliseconds), Maximum consecutive violations, and Retry internal (seconds) fields, or keep the default values.
- Use application settings – Select this option to use the
application settings to define the values in the Maximum duration for service
activity (milliseconds), Maximum consecutive
violations, and Retry internal (seconds) fields.
Use the Down arrow key in each field to select an existing application setting from the
At run time, the application uses the values in the application setting that correspond with the current environment. For example, if you specify 30 seconds for the retry interval for the Development value, the application uses a 30-second retry interval in your Development environment at run time. If no values are specified, the application uses default values.
- To run the service with lightweight clipboard pages, in the Lightweight
clipboard mode section, select the clipboard page that you want to use.
- Select Use application settings.
- In the Setting name field, press the Down arrow key and select a clipboard page.
- In the Execution mode field, choose from the following
- Execute synchronously – Select this option if you want the service to run the request immediately.
- Execute synchronously (queue on error) – Select this option when you want the service to queue the request for asynchronous execution only if processing fails while executing the service activity.
- Execute asynchronously (queue for execution) – Select this option when you want the service to queue the request for asynchronous execution, return the Queue Item ID to the external application, and end the service call while the processing starts.
- In the Request processor field, select a request
processor.The list in this field displays only the request processors that are defined for the same service package as this service rule. If you have not defined a request processor, click the rule opener to create a new one.
For more information, see Service Request Processor data instances.
- To specify whether to monitor this rule, and whether to include the clipboard state
when monitoring, in the Service monitoring field, click
- To enable monitoring for this rule, in the Select service monitoring field, select Yes.
- If you enable monitoring and you want to include the state of the primary data page in the monitoring results, in the Capture clipboard state field, select Yes.
- Click Submit.
- Optional: The Service package (includes additional processing options) displays a link to the service package that contains this service REST rule. To easily navigate to the service package if you need to make changes to it, click the link.
- Click Save.