Wednesday, October 16, 2019

Creating the Service REST: Pega How-to Guide


Going to the “Records Explorer”, under the “Integration-Services > Service REST”, right-click on it and select “Create”.

Figure 30: Creating a Service REST

In the opened form as shown below, there are basically 4 inputs, enter those accordingly.
 
Figure 31: Configuration of Service REST

Rather than trying to explain what each of the above represents, it is easier to explain by showing you how those are being used by Pega.

After you have clicked the “Create and open” button, the following will be shown:
 
Figure 32: Service REST – DBTestService

As you observed:

  • Service name: This is the name that you give to the rule
  • Service package name: This allows you to group related Service REST into the same package, such that they will have the same IP address and base URL
  • Service version: Allows you to specify version for the same Service REST
  • URI Template: Enables you to specify additional string to add to the base. This usage enables users to pass parameters through the URL, instead of using the Query String


💡
Note: In the above diagram, you will notice that the "Page class*" has a value of "DB-DBRest-Int". You need to provide a value for this before you can save this rule.

💡
Note: For the "Page class*", generally, you should specify some relevant class for your specific situation. However, in my case, I had specified it as "DB-DBRest-Int", where “DB” is the ORG NAME, DBRest is the application name. The implication is that all other related rules, such as the various activities for the methods would be stored under this class.

💡
Note: Class structure and inheritance is a big topic in Pega. If I were to bring it here, it would just cause a lot of confusion. Therefore, I had designed this How-to Guide such that there is practically no need for you to know about the class structure and inheritance. If you need to, you can always add that in and move the rules to the relevant location.


Oh, by the way, just in case you didn’t realise, your Service REST is already working!

Notice the URL under the “Service endpoint URL”? If you copy that URL to the Chrome browser, you will be able to get the output. Of course, you will get nothing since you have not implemented anything yet. So let’s do this now!




No comments:

Post a Comment