You are here: Reference > Rule types > Service REST rules > Service REST form - Completing the Service tab

Service REST form
Completing the Service tab

  1. About 
  2. New 
  3. Service 
  4. Methods 
  5. History 
  6. More... 

Complete the Service tab to identify the activity called by this Service REST rule.

Primary Page

Field

Description

Page Class

Required. Select the page class for the primary page for the data returned by this service.

Data Transform

Optional. You can select from the menu a data transform to use with this service to normalize the data received.

Page Name Required. Provide a name for the primary page. The name should have no spaces and use no special characters.

Field

Description

Resource Path

Optional. Enter the URL of the web service.

Resource Params  
Name

Enter the name of the dynamic resource parameter in the resource path.

Description

Enter a description for this parameter.

Map To

Specify the destination or the type of destination for the value in the Pega Platform:

  • Clipboard — Map to the page name or property on the clipboard specified by the Map To Key field.
  • 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.
Map To Key

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 the data be mapped at runtime.
  • 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.
Primary Page  
Page Class

Specify the Applies To class of the service activity.

Data Transform

Optional. Identify a data transform in the class identified in Page Class. The system applies this data transform immediately after it creates the page.

Page Name

Enter a page name for the class specified in the Page Class field. This page is the top-level clipboard page that PRPC uses as the primary page when running the activity called by this REST service. The property values can be written to or read from this page.

Enter any page name, or accept the default value MyServicePage. (This page name has no special characteristics.)

Processing Options
 
End requestor when done?

When services in the service package are stateful, select this option to have the system end the requestor after the activity ends and the response is sent.

This option applies only when the Processing Mode field on the service package data instance is set to Stateful. If the services are stateless, this value in this field is ignored.

Method is read-only

Leave cleared in most cases. Select to indicate that each use of this service is not to count as a service invocation under the terms of your license agreement. See Working with the License Compliance facility.

Execution Mode

Select one of the following options:

  • Execute synchronously — select this option when 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 in the event of a processing failure while executing the service activity. If there is no processing error, the result is the same as a normal synchronous request. If there is a processing error, the error details are stored in a Service Request Processor data instance (Data-Admin-RequestProcessor-Service class), along with the request data that was originally mapped to the clipboard. The service returns the Queue Item ID to the external application, and the request is either reprocessed automatically by an Agent configured for queue processing, or manually by a system administrator.
  • 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. Choose this option only if a Service Request Processor data instance (Data-Admin-RequestProcessor-Service class) exists with a key that matches the Service Package key part of this service rule. (When the queued service request executes, the execution is performed with the authorization profile of the service.)

For more information, see PDN articles How asynchronous service processing works and Configure a service to process requests asynchronously.

Request Processor

If you select Execute asynchronously in the Execution Mode field or you configure a Queue When condition on the Response tab, select the name of the service request processor (instance of Data-Admin-RequestProcessor-Service). The list in this field displays only the request processors that are defined for the same service package as this service rule.

Enable service SLA with fallback activity

Optional. This option is displayed for synchronous execution modes. When selected, you can 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 resumed.

Using a service SLA ensures that a logical response is made in a timely manner. Configure the fallback activity on the Methods tab. If a fallback activity is not configured, the default response is sent back.

Maximum duration for service activity (milliseconds) This option is displayed when you select Enable service SLA with fallback activity. 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 This option is displayed when you select Enable service SLA with fallback activity. Enter the number of SLA violations that must occur before the fallback activity is called. The default is 3.
Retry interval (seconds) This option is displayed when you select Enable service SLA with fallback activity. Enter the amount of time, in seconds, to wait before attempted to process the service activity. The default is 10 seconds.

About Service REST rules