Exposing an application as a service
The two most common ways to expose your application as a service are either to leverage the Pega API or to create a web service with the Service wizard.
Conceptually, these two options work the same way: a request is made to a URL, and a response is returned. The difference is how you communicate with the service.
The Pega API
The Pega API provides a standard set of services that includes new case creation, assignment processing, and access to data pages. These built-in REST/JSON services enable the rapid implementation of Pega-powered mobile and client applications.
You can call any of the Pega API services by using standard HTTP methods (for example, GET, POST, or PUT). Refer to the Pega API resources page in Dev Studio or App Studio (in Dev Studio, click the Resources menu and select Pega API; in App Studio, click Channels and select API to see details of the request and response data requirements.)
This documentation is also available in JSON format in the Docs API (GET/docs).
|Assignment API||Provides the ability to obtain a list of assignments for a user, obtain the details of any specific assignment, and perform an assignment action.|
|Authenticate API||Allows you to verify user credentials.|
|Cases API||Provides the ability to obtain a list of cases for a user, create a new case, obtain case details, and update a specific case.|
|Casetypes API||Provides the ability to obtain a list of case types for the authenticated user.|
|Data API||Facilitates the process of obtaining the contents of a data page and obtaining the metadata for a specific data page.|
|Docs API||Provides access to the complete documentation for the Pega API.|
For more information about the Pega API, see Pega API for the Pega Platform.
The Service Wizard
For most situations, Pega API covers service needs using the REST protocol. Pega Platform™ also supports the creation of services using other protocols through the Service Wizard. Creating a service through any method exposes a Pega Platform data page securely. However, it is best practice to use Pega API when possible.
The following image shows the service protocols available in the Pega Service Wizard.
Access the Service Wizard by clicking Configure > Integration > Services > Service Wizard. The Service Wizard generates rules and data objects for services that perform one of the following tasks:
|Create and manage work||Create new work items or perform actions on a work object such as a flow action.|
|Invoke existing activity rules||Call an activity and select service parameters.|
|Process input or output data||Map data to or from the clipboard.|
The Service Wizard completes each of these tasks through five general steps, for which the Service Wizard displays a sequence of forms to fill out that define the appropriate service rules and the supporting data objects. Some service purposes may contain more sub-steps than others due to the nature of their configuration. When you finish, the Service Wizard displays the values you specified and allows you to review and modify the values of those settings before creating the service rules. The general steps are, in order:
|Service Wizard Step||Description|
|Select Service Purpose||Select one of the three service purposes, as illustrated in the table above.|
|Provide Service Details||Choose elements that apply to the generated service rules.|
|Customize Service Data||Customize the request and response message data for each new service rule.|
|Select Service Resources||Select a ruleset name and version for all newly generated rules and preferred options for configuring the service package.|
|Review and Save||Lists choices and customizations for review before generating the new service rules.|
Note: The Provide Service Details step appears in the wizard order only after completing the Select Service Purpose step.
Check your knowledge with the following interaction.