Friday 24 May 2019

How to add compatibility Meta Tags in Pega

How to add compatibility Meta Tags in Pega


In this post will see how to add compatibility meta tag in head tag.

For Clear Understanding about Meta Tag Please refer this link

Now in this post we are going to add the below meta tag to Html head tag.

<meta http-equiv="x-ua-compatible" content="IE=edge"> 


Look at the above two screenshot. I inspected Case worker portal and within the head tag there is no Meta tag like http-equiv="x-ua-compatible".

In pega there is an option to add JS file in Harness. In harness open scripts and style tab.

Here add a new JS File and open that js file and paste below code in that file.

var meta = document.createElement('meta');
meta.httpEquiv = "X-UA-Compatible";
meta.content = "IE=edge";
document.getElementsByTagName('head')[0].appendChild(meta);
Functionality of this code is to add append meta tag to head tag.

Save the JS File and harness . Refresh the harness and check whether new Meta Tag is added or Not using Inspect element.

Saturday 11 May 2019

Why Data Page (or) Declare Page in Pega?

Why Data Page (or) Declare Page in Pega?

Why Data Page (or) Declare Page in Pega?


Why Data Page (or) Declare Page in Pega?

Why Data Page (or) Declare Page in Pega?

Wednesday 8 May 2019

Refresh section using ReloadSection activity in Pega

Refresh section using ReloadSection activity in Pega


I faced one scenario to reload section using activity in my work. I will explain how to refresh section using activity.

ReloadSection in class Name @baseclass is the pega activity which will call during section refresh, We have to pass some needed parameter to this activity to execute this activity. Some needed parameters are 
  • StreamName - Section name to refresh
  • StreamClass -  Class Name of the Stream. If the rule we are refreshing is section then class will be Rule-HTML-Section, if the rule we are refreshing is HTML Fragment then class will be Rule-HTML-Fragment. 
Below is the section that we are gonna refresh when CustName property value is changed.

I Created a Declare On Change rule to monitor CustName , If this property has Changes then it will trigger the activity"CalculateCustDetails"
Below is the activity that will execute on CustName property changes.

In First step I added a Property set to setting parameter that we have to pass to ReloadSection activity.

In Stream Name parameter provided the section name 
In Stream Class parameter provided the Section Class(Rule-Obj-Section)

We can pass extra parameter like pre activity to execute before section reload for this activity.

So If I am provide any name in the CustName property dynamically it will change the name to Rahul(HardCoded Name in above acitivity) and it will refresh the section. Lets try it.

I am providing the name chaitanya . On ReloadSection activity execute it will change the name to Rahul Lets try it.


After section refresh,


That's it. Hope you understand this post. If any doubt ask in Comment 😊

Note: If we are providing StreamName as section class name then it reload section will through below error.

* Missing stream key property pyID *

Cascading Auto Complete in Pega

Cascading Auto Complete in Pega

Functionality to implement: Have to display list of Country, then based on country selected have to show list of state, based on state selected have to display list of city.

Created a Local Data Table(TGB-HRAPPS-Data-LocationInformation) with sample data.


Created a section in Work class with 3 auto complete (Country, State, City)


For Country Property provided source as Report Definition and mapped Report Definition(GetCountry)


Provided Data source Property as .Country(TGB-HRApps-Data-LocationInformation) .List of country which is retrieved through report definition will display dynamically.


Below image displays GetCountry Report Definition. Checked Remove duplicate Check box so it will remove duplicate country.

Similarly state property also selected source as report definition. For GetState we have to pass selected country as parameter so that we can filter state which is in selected country.


For Data Source Property we have to give state which is retrieved in report definition.


Below image shows GetState report definition , Here we are getting List of state in the selected Country.


For city provided source as report definition(GetCity)


Provided City as Data source property.


Below image shows report definition to get city.


For all three property we have to give on change event as post value. So that selected value will update in Clipboard.


Result:

On clicking Down Arrow auto complete displays list of country.


Display list of state in country America.


In City auto complete it display list of city which is in state American State one.


Friday 3 May 2019

Screen Flow in Pega


Screen Flow in Pega


Screen Flow is used when we have to capture large amount of data. We can divide large content into smaller separate screen and we can integrate those separate screen into a Screen Flow.

Configuring Screen Flow is easy task. Lets see how to do that.

Creating Screen Flow:

There are two type of Flow
  1. Screen Flow
  2. Starter Flow


We can click in +Create select Process-> Flow to open a new instance rule.
In Apply to provide the class name in which we want to create the flow and in Label provide the Flow Name.

On Clicking the link "Remove additional configuration options" Below layout will display. There we have select "Standard template for screen flows" to create screen flow.


In Screen flow flow action will be in assignment not in connector, lets check that.

I clicked on the assignment(Perform Task) in the pop-up you can see the flow action name. So this flow is confirmed as screen flow :)


Added fresh 4 assignments . Lets add flow action in each assignment.

Added flow action in each assignment and saved the flow.

Normally after processing each assignment a commit operation will be performed . This will write multiple time to db when user switch between assignments while processing the flow.

There is a option to write to db only on completing the flow. That option will be there in start shape of the screen flow.
In the above Image you can see "Save on last Step". If you checked this the data will commit to db on last step. It is best practice to check "Allow errors" when checking "Save on last step".

Lets run the flow and view the UI of the screen flow.
Here is the screen flow that we expected.😊. 


Lets change the Harness of screen Flow from TabbedScreenFlow to TreeNavigation7 and check the UI Difference.

Lets check its UI.


I learnt Screen Flow today. Hope you also understand about this. Thank you for reading :)