Simulations in pega

What is the simulation in pega?

Simulating integration connectors to see how the response is coming or when there is no data source is available/external system is not available. We will define our own data source and test the integration. Use simulations to unit test the integration connector. We can simulate any external service as long as we know that "what is the request it is expecting and what is the response it is going to return".

How to simulate an integration in pega?

We know that pega uses connectors to integrate with an external system to get some data, so we can simulate all integration connectors except SQL connector in pega. Any connector can be invoked from a data page or an activity.  
simulation in pega

Data page simulation in pega (Simulating data page source)

In the data page rule select the "Simulate data source" check box, once selected existing data source will be disabled and we can define new sources by using a data transform, report definition, or activity.
data page simulation in pega

The data source is disabled after selecting the Simulate data source check box.
define data page simulation in pega

Let's use data transform to simulate data sources.
We can see simulated data types and data pages in both Dev and App studio.
Dev studio:
Configure -> Data Model -> View external data entities to open the External Data Entities landing page and get an overview of simulated data pages in your application. 
Source systems marked with a green dot are production-ready. Source systems marked with an orange triangle are simulated.
simulate data page in pega

data source status
App Studio:
Data Explorer -> Integration Designer. Select the Simulated icon in the system of record row to filter by the simulated data types and find all the simulated data pages quickly.
simulate data page in pega app studio

Simulation activity in pega

If the activity is an integrator activity where we used to invoke the Integration connector and the external source is not available or not ready, we can simulate the data by using a data transform.
Create a data transform and set the data like how we map response in a data transform by using request fields. Refer this data transform in Integration activity by using the "Apply-DataTransform" method.
Integration activity sets the data returned by the data transform on the integration page.
simulation activity pega

Once connector activity is ready with simulation data refer to the Connector rule to simulate the Integration connector.

Connector simulation in pega

We can simulate an integration connector when the external service is not yet ready or not yet deployed.

We can configure the Connector simulation in two ways.
1. Connector rule form
connector simulation in pega


Global -
Select this option for all the users in the application to use this simulation.
User Session -Select this option only for the current users to use this simulation.

2. Landing page -Dev studio - Configure > Integration > Connectors > Connector Definitions & Simulations, all existing Integration connectors and their simulations.

total connector simulations

Configure Simulation activity for all connectors in the list by clicking "total simulations link".

configure simulation for connector in pega

Note: We can configure simulations for most of the connectors except SQL connectors.




3 comments:

  1. Very useful information. Thanks for sharing. Please keep post.

    ReplyDelete
    Replies
    1. Thank you, hope you will like other topics as well.

      Delete