Posts

Showing posts from 2020

Create a zip file with multiple files in Pega V851 and is password protected too

Image
  One of my friends came with a requirement like- Is there anyway we can create a zip file with multiple files from Pega? Also, he asked me to protect the final zip file after finishing the process .After digging a bit in the net, I got an opensource (zip4j) since we don't find a direct OOTB feature for this usecase. This opensource was built by Srikanth Lingala and is based on pure java. There might be other opensources to create a zip file in the market but this one provides security on the final zip file. This opensource comes with a single jar file to import in Pega to get all necessary files to work on this exercise. Here is the link to download the jar file:  https://jar-download.com/artifacts/net.lingala.zip4j/zip4j/1.3.2/source-code   As usual, I created a simple Pega function with the java code by importing the necessary packages in the library rule. Called this Pega function from a Data Transform and tried with 2 files and created a pwd protected zip file after ...

Easy to install Pega Customer Decision Hub(CDH) in Pega Infinity V851 PE

Image
Before we install, let's get a high level idea on Pega Customer Decision Hub. Customer Decision Hub is a solution that combines data management, decision management, and advanced analytics across multiple channels. CDH is fully integrated with Pega Platform and can utilize many of its features to ensure that decision-making in your application is always driven according to the Next-Best-Action principle. You can use Pega Platform to build your own decision-making hub that quickly and accurately provides the most relevant value-added decisions. Customer Decision Hub comes as part of Pega Marketing by default. CDH can also be added to Pega Strategic Applications, such as Pega Customer Service or Pega Sales and Onboarding. For more details, visit Pega Community site. It is very easy to install Pega CDH in Pega Infinity running on V851 PE provided we should have that CDH8.5 software with us. The key for this installation is to get the CDH packages, DB scripts etc before we start impl...

Enable/Disable the REST API service specific loggers in Pega

Image
There may be an instance where we need to capture the errs/issues while working on REST conn/service. We know that Pega gave OOTB loggers to enable/disable in the Designer Studio (Pega 7.x) or Admin Studio (Pega 8.x). The below 4 loggers are required in REST side. Enable them in the sys based on the needed level (Err/Debug/All/Warn/Alert/ Fatal). Below are sample screenshots to understand on how we can set them in both Pega V7 and V8.   Logger Names:   com.pega.pegarules. integration.engine.internal. util.PRServiceUtils (Any Service) com.pega.pegarules. integration.engine.internal. ServiceMappingUtils (Any Service) com.pega.pegarules. integration.engine.internal. connect.rest.RESTClient (REST Connect) com.pega.pegarules. integration.engine.internal. connect.rest.RESTConnector ( REST Connect)   When we associate a log level with a log category, the log messages of this category are written to a log file. The log level applies to all the loggers that we are associate with t...

Manage Pega V851 API's via Open API Gateway (WSO2)

Image
In this post, let us focus on how Pega API's can be managed via any Open API Gateway like WSO2. To work on this exercise, we need the below prerequisites. 1) Create a Service-REST API in Pega [Eg: Create a HR Service case in this context] 2) SwaggerHub tool to import the API's YAML data from the above step 3) WSO2 tool to publish and invoke the above API service Create a Service-REST API: Follow the below simple steps from Pega using Service-REST Capture the YAML data from the above created service and update the server URL with tunneled URL generated by using ngrok.exe [Eg: run the command "ngrok http 8082" from command line prompt] Copy/mark the https URL from command line prompt and update the YAML file in the editor shown in below video. SwaggerHub tool editor to import the API's YAML data:  A brief idea on this tool before we start using this Opensource at our end. Swagger is a set of rules (in other words, a specification) for a format describing REST API...

Easy to create CSS login screens using Pega PE V851

 We all know that we have OOTB login screen given by Pega and is built on CSS and HTML. But the login screen in OOTB is a static screen and is not a flash/animated gif screen where we have the rich look & feel. Pega won't stop us to leverage these animated login screens in the system. To implement a animated login screen, we need the custom CSS and JS files to update the Pega rules in a specific ruleset version accordingly. The main HTML rule: @baseclass.Web-Login in Pega is used to create the login screen. There is a OOTB rule: py-login-screen where it has the CSS specifications to use in the login form.  To begin on this exercise, first you need to have a dedicated ruleset for making the changes. I am giving my old post link where you have all the steps mentioned to create a ruleset in this context. Here is the link to follow before we start this PoC.  http://pisupativenkatasesha.blogspot.com/2020/12/how-to-change-pega-login-screen-with.html  First of all, we...

Validate Credit Card from Pega UI using Luhn algorithm

Image
Not sure on how many folks know about Luhn  algorithm to validate the CC number using java/javascript logic. Most credit cards and many government identification numbers use this algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers. Recently I gave a simple solution to one of my friends on validating the CC number using this algorithm. Here is the idea on how I have provided the solution for him. There are mainly 3 steps we need to follow while building the logic in the Pega function to be called from the UI text field. To know more about this algorithm, google it and you can get more info. Not sure if there is any other better option to validate CC's. I am also not sure whether we have any OOTB feature given by Pega on this validation.  Here are the steps to be followed in Pega: 1) Create a Pega function with java logic to validate the CC by passing the CC number as a parameter 2) Add a sample text field on the UI and have ...

How to change the Pega login screen with custom logo and background?

Image
It is very easy to change the Pega login screen with your custom logo an the background. Here are the simple steps to follow. 1) Create a ruleset: Unauthenticated under version:01-01-01 and make it for checkout the code. Make sure to add this ruleset in the application rule's stack 2) Create an access group =>  Acme:Unautenticated and point your application with a role: PegaRULES:Guest . Set the workpool to the work class and set the Production Ruleset to Unauthenticated 3) Edit the Requestor Type: Browser(pega) by adding the access group => Acme:Unautenticated  and make it selected as default access group 4) Download any custom logo an the background image files from google images. In my case, Acmelogo.png and AcmeBkgrnd.jpg 5) Upload both these files into Pega using Records -> Technical -> Binary File. Make sure to use the App Name(Directory) as webwb under the ruleset: Unauthenticated accordingly 6) Now it is the time to update the login screen specific...

itextpdf API to generate PDF doc from an image file using Pega PE

Image
Probably some of the techies might have an idea on an opensource called " itextpdf " (earlier name is lowagie ) to convert an image file(png,jpeg,jpg,tiff,gif etc.) to a PDF file. It is very simple to use this API in Pega function to build the logic using java code. Moreover, this API comes in one single jar file and we need to import it in Pega before we start using it.  I see the conversion comes good in PDF file but not sure if any limitations of this API in terms of conversion is like formatting, font, images etc. So far so good and may be we can keep this API as one of our solutions while working on the requirements accordingly.  Heard that same API can be used to convert the text file to PDF but I didn't explore on it. Those who are interested to work on text -> PDF can take a look at the documentation. Don't hesitate to contact me offline for any further discussion in this context :) :) Prerequisites for doing this exercise: 1) itextpdf 5.4.0 jar file 2) Peg...

Simple steps to change the localhost URL (Pega PE)with a custom site address while accessing it from browser

Image
I hope most of the Pega experts know these steps. But I would like to share this simple exercise for unknown techies.  It is very easy to change the localhost URL with our custom site address. Here it is how it shows after following simple 7 steps 😊😊. Pls don’t get confused on the alias option given by Pega product in the application rule. Moreover the below custom changes would be applied in the app rule as well. Step1:  Open notepad as administrator from Windows icon -> notepad  Step2: Open File->Open in notepad and copy this path C:\Windows\System32\drivers\etc and select "hosts" file. Step3: Replace # 127.0.0.1 localhost to 127.0.0.1 www.mypegalocal.com and save the file. Before making the changes, better take a backup of this "hosts" file. Step4: Open "tomcat" folder in your Pega PE and search for server.xml and open it. Change http port number to 80 by adding the below to existing <Connector/>.  Before making the changes, better take...

Microsoft Graph API integration from Pega V8.x

Image
Brief idea on MS Graph API: Microsoft Graph is a Microsoft developer platform that connects multiple services and devices. Initially released in 2015, the Microsoft Graph builds on Microsoft 365 APIs and allows developers to integrate their services with Microsoft products, including Windows, Microsoft 365, and Azure. The Microsoft Graph API offers a single endpoint, https://graph.microsoft.com, to provide access to rich, people-centric data and insights exposed as resources of Microsoft 365 services. Microsoft Graph exposes REST APIs and client libraries to access data on most of the Microsoft cloud services.  The below diagram gives a high level idea. The Microsoft Graph explorer is a tool that lets you make requests and see responses against the Microsoft Graph. To access this tool, we need to have access in Microsoft Azure Portal. I have free trial access with limited features from Azure. Here is the portal URL to get the access: https://portal.azure.com/  Here is the...

Convert Word document to PDF using opensource: docx4j API in Pega V8.x

Image
 To convert a word document(.docx) into a PDF document, we can use the opensource:docx4j. In order to work on this API, we need to import 42 jar files in Pega V8.x. The list of all jars are given below and we can use Import wizard in Dev Studio to import all these jar files and store the data into the corresponding table:PR_ENGINECLASSES. After importing them, we need to recycle/bounce the server after clearing the cache. All the below jars can be searched from google and download them into your local folder. Here are the next steps to follow in Pega to experiment on a sample word doc to convert into PDF. 1) Create DSS rules for capturing the Word Doc and PDF Doc files path. I took the path as C:\Users\urspv\Documents\Pega\V85\PRPCPersonalEdition\tomcat\temp\Misc and kept a sample word doc like Test.docx. After running the DataTransform, we can see the new Test.pdf in the same path. 2) Create a Pega function with the below java code. The function has 2 parameters like WordDoc,...

REST Service API to create a Pega case and attach a file to the case using SOAP UI

Image
 To perform this small exercise, we need the below prerequisites. 1) SOAP UI tool 2) Pega V8.4 case type in a working PE In this context, I have created a simple case type: Leave Request where there are 3 stages to capture leave request info for an employee and resolve the case by approve/reject. For more details about the case type design and the sample case UI screen. Create a REST-Service instance to create a case and the logic to capture the file from SOAP UI request. Below is the API service call from SOAP UI. Select the Basic authentication, add an attachment from the Attachment section. Select the Media Type as "multipart/form-data". Method should be POST. Below is the case ID:LR-6 with the attached image file after successful execution. References: 1) Pega developer help 2) Pega community site

How did I prepare for AZ-900 exam?

Image
 The basic fundamentals from Azure cloud is covered in this AZ-900 certification. Though the topics from the blueprint given by Microsoft looks easy but the questions in the exam are not that easy to answer. There were 33 questions asked in my exam and the pass mark should be 70%. From the exam, there were multiple choice, multi select, practical oriented questions given to test the knowledge.  Here are the topics and the way of my preparation to pass the exam with 820/1000. Microsoft Learn Modules Aligned to AZ-900 Skill Measured Microsoft Learn Module 1. Understand Cloud Concepts                https://docs.microsoft.com/en-gb/learn/modules/principles-cloud-computing/ 2. Understand Core Azure Services https://docs.microsoft.com/en-gb/learn/modules/welcome-to-azure/ https://docs.microsoft.com/en-gb/learn/modules/explore-azure-infrastruct...