Skip to main content

Integrating an unattended RPA project with a Pega application

6 Tasks

15 mins

Pega Robotic Automation 22.1
Visible to: All users
Beginner Pega Robotic Automation 22.1 Robotic Process Automation English

Scenario

U+ Bank has developed a Customer Support application to process credit card transaction disputes. The goal of the application is to streamline the time of the client and the CSR by automating communication with the BankerInsight application.

Complete the following tasks:

  • Create a ProcessDisputeTxn automation that logs in to the BankerInsight application and searches for a customer. 
  • Create a subautomation that opens the Dispute tab in the BankerInsight application, searches for the concerning transaction, and gives it a DISPUTE label
  • Create an automation that displays the result of dispute processing.
  • Create a robot activity automation that incorporates the other automations to complete the request.
  • Debug automations locally.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Add message definitions

  1. Download the UBank project:
  2. Save the file to your desktop and unzip the file to extract the project folder to your C:\Users\<username>\Documents\Pega Robot Studio\Projects\.
  3. On the Home screen in Pega Robot Studio, click Open Project, and then navigate to the projects folder and open UBank.pegaProject
    Note: The starter project includes a configured BankerInsight application. The value of the Path field must match the location of BankerInsight on your local computer for the project to function properly. In the BankerInsight application, change the value of the Path to the location of your BankerInsight application.
  4. In Project Explorer, click the Information icon next to the UBank label to display the properties grid.
    Screenshot showing the 'i' icon that displays project property grid.
  5. In the Runtime section of the properties grid, click the More icon to open the Message manifest dialog box.
    Screenshot showing the access to Message definitions designer.
  6. Click the Add button to open the Edit message definition dialog box.
  7. In the dialog box, add the following message definitions to the project:
    Code Caption Icon Button Message
    BI001 BankerInsight Error OK Application starting failed
    BI002 BankerInsight Error OK Application timeout
    BI003 BankerInsight Error OK Customer not found
    BI004 BankerInsight Error OK Login failed
    BI005 BankerInsight Error OK Dispute failed
  8. On the Message definition dialog box, click Done. The message definitions should look as shown in the following figure:
    Screenshot showing message definitions for the project.

2 Create the ProcesDisputeTxn automation

  1. In Project Explorer, add a new automation:
    1. On the Project tab, click Add > Automation to open Add new automation dialog box.
    2. In the Add new automation dialog box, enter ProcessDisputeTx, and then click Add
  2. On the Automation tab, in the Palette, click Include to open the Include in palette dialog box. 
  3. In the Include in palette dialog box, click the Application tab, and then click the Add icon to add the BankerInsight application to the automation, then click Done.
  4. On the Palette tab, expand the Applications section and drag the BankerInsight control to the automation surface to open the Select Action dialog box. 
  5. In the Select Action dialog box, click More and in the search field, enter LogIn.
  6. Select the LogIn application method, and then click Add to add it to the design surface. 
  7. On the LogIn design block, update the parameters:
    1. In the username field, enter pega.
    2. In the password field, enter pega.
  8. Repeat steps 4-6 to add the CustomerSearch application method to the design surface.
  9. On the automation surface, add an Entry Point, Exit Points, Labels, and error handling
  10. Design block name Actions
    Entry Point

    Right-click the automation surface, and then select Add > Entry point.


    Success Exit Point
    1. On the automation surface, right-click, and then select Add > Exit Point.
    2. Click the name of the Exit Point, and then enter Success.
    3. On the Exit Point, click the Add icon to add an output parameter.
    4. In the first Type list, select String, click param1, and then enter msgDetails.
    Failed Exit Point
    1. On the automation surface, right-click, and then select Add > Exit Point.
    2. Click the name of the Exit Point, and then enter Failed.
    Success Label
    1. On the automation surface, right-click, and then select Add > Label.
    2. On the Label, click Label1, and then enter Success.
    Failed Label
    1. On the automation surface, right-click, and then select Add > Label.
    2. On the Label, click Label1, and then enter Failed.
    3. On the Label, click the Add icon to add a parameter.
    4. In the Type list, select String, click param1, and then enter msgDetails.
    Jump to Failed (two times)
    1. On the automation surface, right-click, and then select Jump To > Failed to add a Jump To design block.
  11. Connect the design blocks as shown in the following figure:
    An image showing the first design blocks of the Process Dispute Transaction automation with links
  12. On the toolbar, click Save to save the automation.

3 Create the AddTransactionAsDispute automation

  1. In Project Explorer, add new automation and name it AddTransactionAsDispute to open the automation tab:
    1. On the Project tab, select Add > Automation to open Add new automation dialog box.
    2. In the Add new automation dialog box, enter AddTransactionAsDispute, and then click Add
  2. On the automation surface, right-click, and then select Add > Entry Point to add the component to the surface.
  3. On the Entry Point, click the Add icon three times, to add three input parameters.
  4. Update the input parameters:
    1. In the first Type list, select String, click param1, and then enter transactionId. 
    2. In the second Type list, select Float, click param2, and then enter txnAmount.
    3. In the third Type list, select String, click param3, and then enter txnDescription.
  5. On the Automation tab, in the Palette, click Include to open the Include dialog box. 
  6. In the Include dialog box, click the Application tab, and then click the Add button to add the BankerInsight application to the automation, then click Done.
  7. Add the following design blocks to the automation surface:
    Design block name Actions
    tabAccountMgmt.SelectedIndex property
    1. On the Palette tab, click Applications > BankerInsight > frmBankerInsight, and then drag the tabAccountMgmt control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter selectedIndex.
    4. On the Property tab, select the checkbox for the SelectedIndex property and then click Add(1).
    5. On the design block, click SelectedIndex parameter and enter 2.
    tabDispute.PerformClick method
    1. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt, and then drag the tabDispute control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the PerformClick (no parameters) method, and then click Add.
    txtTxnID.Text property
    1. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt > tabDispute, and then drag the txtTxnID control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the property, and then click Add.
    txtDisputeAmount.Text property
    1. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt > tabDispute, and then drag the txtDisputeAmount control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the property, and then click Add.
    txtDisputeDescription.Text property
    1. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt > tabDispute, and then drag the txtDisputeDescription control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter Text.
    4. On the Property tab, select the property, and then click Add.
    btnDisputeSearch.PerformClick method
    1. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt > tabDispute, and then drag the btnDisputeSearch control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the PerformClick (no parameters) method, and then click Add
    btnDisputeSubmit.PerformClick method
    1. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt > tabDispute, and then drag the btnDisputeSubmit control to the automation surface. 
    2. In the Select action dialog box, click More.
    3. In the search field, enter PerformClick.
    4. On the Method tab, select the method, and then click Add
  8. On the Palette tab, click Locals > Run, and then drag the following local variables to the automation surface:
    • transactionId
    • txtAmount
    • txtDescription
  9. On the automation surface, connect design blocks and input parameters with corresponding input fields in the dispute form of the BankerInsight.
    An image of the first design blocks linked with input parameters on Add Transaction As Dispute automation
  10. On the Palette tab, drag labelDisputeResultMsg control to the automation surface.
  11. In the Select action dialog box, select the Text Changed event and then click the Add icon to add it to the automation surface. 
  12. Right-click on the TextChanged design block and select Wait for this event.
    Screenshot showing the context menu with Wait for this event option.
  13. On the Palette tab, click BankerInsight > frmBankerInsight > tabAccountMgmt > tabDispute, and then drag labelDisputeResultMsg to the automation surface.
  14. In the Select action dialog box, select the Text property, and then click the Add icon to add it to the automation surface.
  15. On the Toolbox tab, click Data handling > Strings > Compare, and then double-click Equals to add the method to the automation surface. 
  16. On the Equals design block, update the input parameters to check the dispute result:
    1. Drag the labelDisputeResultMsg output data link to the string1 parameter data connector.
    2. Click string2, and then enter Transaction Not Found.
    3. In the stringComparisonTypelist, select CurrentCultureIgnoreCase.
  17. In the automation, click and draw automation and data links that resemble the following image:
    Image of first text change Wait event to that prompts the transaction search
  18. In the automation, right-click the labelDisputeResultMsg.WaitForEvent design block.
    1. Click Copy.
    2. Right-click the automation surface and click Paste
  19. Repeat step 19 a-b for the labelDisputeResult.Text property and the String.Equals method design blocks. 
  20. On the second Equals design block, update the input parameters to check the dispute result:
    1. Drag the labelDisputeResultMsg output data link to the string1 parameter data connector.
    2. Click string2, and then enter Success.
    3. In the stringComparisonTypelist, select CurrentCultureIgnoreCase.
      Screenshot showing automation and data connections for submit dispute part of the automation.
  21. On the automation surface, add an Exit Points, Labels, and error handling
    Design block name Actions
    Success Exit Point
    1. On the automation surface, right-click, and then select Add > Exit Point.
    2. Click Exit1, and then enter Success.  
    3. On the Exit Point, click the Add icon to add an output parameter. 
    4. In the first Type list, select String, click on param1, and then enter msgDetails.
    5. In the second Type list, select Boolean.
    Failure Exit Point
    1. On the automation surface, right-click, and then select Add > Exit Point.
    2. Click the name Exit1, and then enter Failed
    Failed Label
    1. On the automation surface, right-click, and then select Add > Label.
    2. Click Label1, and then enter Failed.
    3. On the Label, click the Add icon to add a parameter.
    4. In the Type list, select String, click param1, and then enter msgDetails.
    Success Label
    1. On the automation surface, right-click, and then select Add > Label.
    2. Click the name Label1, and then enter Success.
    Jump To Failed
    1. On the automation surface, right-click, and then select Jump To > Failed.
    2. Click msgResult parameter, and then enter BI005.
    3. On the Jump To block, click Result, and then select False.
    Jump To Failed
    1. On the automation surface, right-click, and then select Jump To > Failed.
    2. Click msgResult parameter, and then enter BI005.
    3. On the Jump To block, click Result, and then select False.
    Jump To Success
    1. Right-click the automation surface, and then select Jump To > Success.
    2. On the Jump To block, click result, and then select True.
  22. Connect the design blocks as shown in the following figure:
    Image a completed automation with links
  23. On the toolbar, click Save to save the automation.
  24. Debug the automation and modify the automation for each debugging run to validate all logical paths:
    1. Right-click the first automation link, and then select Toggle Breakpoint to add a breakpoint to the automation. 
    2. On the automation toolbar, click Test.
    3. If prompted in the Test debug dialog box, enter any necessary input parameters and ensure the selection of the Start applications before testing to start or not start the application automatically.
    4. On the automation toolbar, click the Step buttons to step through the automation.
    5. Repeat steps 24a-d to run the debug process and test other logical paths on the automation by changing input parameters or changing the starting of the application.  

4 Use the AddTransactionAsDispute subautomation

Note: Input parameters of this automation will be retrieved from the Customer Support application in the 'Deploying a robotic project' challenge.
  1. In Project Explorer, click ProcessDisputeTx to open the automation.
  2. On the entry point, click the Add icon four times to add input parameters:
    1. In the first Type list, select String, click on param1, and then enter customerNo.
    2. In the second Type list, select String, click on param2, and then enter transactionId.
    3. In the third Type list, select String, click on param3, and then enter txnAmount.
    4. In the fourth Type list, select String, click on param4, and then enter txnDescription.
  3. On the Palette tab, expand Locals > Run, then drag customerNo, transactionId, txnAmount, and txnDescription variables to the automation surface.
  4. On the Automation tab, in the Palette, click Include to open the Include in Palette dialog box. 
  5. In the Include in palette dialog box, click the Automation tab, and then click the Add button to add the AddTransactionAsDispute automation, then click Done.
  6. Double click the automation surface to open the Quick add dialog box. 
  7. In the Quick add dialog box, click Automations, and then double-click the AddTransactionAsDispute automation to open the Select Action dialog box.
  8. In the Select Action dialog box, click the Run method, and then click Add to add it to the automation surface.
    1. On the LogIn design block, update the parameters:
      1. In the username field, enter pega.
      2. In the password field, enter pega.
      1. On the automation surface, add Labels and error handling:
        1. On the automation surface, right-click, and then select Jump To > Success.
        2. On the Jump To design block, click Result > True.
        3. On the automation surface, right-click, and then select Jump To > Failed.
        4. On the Jump To design block, click Result > False.
      2. Connect the design blocks as shown in the following figure: 
        Screenshot showing ProcessDisputeTx automation with input parameters.
      3. On the toolbar, click Save all.
      4. Debug the automation and modify the automation for each debugging run to validate all logical paths:
        1. Right-click the first automation link, and then select Toggle Breakpoint to add a breakpoint to the automation. 
        2. On the automation toolbar, click Test.
        3. If prompted in the Test debug dialog box, enter any necessary input parameters and ensure the selection of the Start applications before testing to start or not start the application automatically.
        4. On the automation toolbar, click the Step buttons to step through the automation.
        5. Repeat steps 13a-d to run the debug process and test other logical paths on the automation by changing input parameters or changing the starting of the application.

      5 Create an automation that sends a dispute confirmation to the Customer Support application

      1. In Project Explorer, add an automation to open the automation tab:
        1. On the Project tab, select Add > Automation to open the Add new automation dialog box.
        2. In the Add new automation dialog box, in the Automation name input field enter SendDisputeConfirmation, and then click Add.
      2. On the automation surface, right-click, and then select Add > Entry Point to add an Entry Point component to the surface.
      3. On the new entry point, click the Add icon twice to add two input parameters.
      4. Update the input parameters:
        1. In the first row, in the Type list, select String, click param1, and then enter customerNo. 
        2. In the second row, in the Type list, select String, click param2, and then enter transactionId.
      5. On the Toolbox tab in the search field, enter concat, and then add the Concat method to the automation surface.
      6. On the Concat design block, update the input parameters to create a confirmation message:
        1. Click the list0 parameter, and then enter: Dispute confirmed for the customerNo:
        2. Drag the customerNo output data link to the list1 parameter data connector.
        3. Click the list2 parameter, and enter ", for transactionId:"
        4. Drag the transactionId output data link to the list3 parameter data connector.
      7. In the Toolbox tab in the search field, enter MessageBox, drag the ShowMessageBox method to the automation surface, then click Submit.
      8. On the automation surface, right-click, and then select Add > Exit Point to add an Exit Point component to the surface.
      9. Click Exit1, and then enter Success
      10. Connect the design blocks as shown in the following figure:
        Screenshot showing SendDisputeConfirmation automation.
      11. In Project Explorer, click the ProcessDisputeTx automation.
      12. On the Automation tab, in the Palette, click Include to open the Include in palette dialog box.
      13. In the Include in palette dialog box, on the Automation tab, click the Add button to add the SendDisputeConfirmation automation, and then click Done.
      14. On the Palette tab, expand the Automations section and drag the SendDisputeConfirmation automation to the automation surface to open the Select action dialog box.
      15. In the Select action dialog box, select the Run method, and then click Add.
      16. On the Palette tab, expand Locals > Run, and then drag customerNo and transactionId variables to the automation surface.
      17. On the automation surface, select the input automation link of the Jump To Success design block, and then press the Delete key.
      18. Connect the design blocks as shown in the following figure: 
        Screenshot showing automation surface with sub-automation that sends the dispute confirmation.
      19. On the toolbar, click Save all.

      6 Add message manifest for error handling

      1. In Project Explorer, click ProcessDisputeTx to open the automation.
      2. On the Toolbox tab, in the search box, enter ShowMessage to filter the results. 
      3. In the Toolbox search results, in the MessageManifest folder, click and drag the ShowMessage method to the automation surface to display the Choose Method Overload dialog box. 
      4. In the dialog box, keep the default selection, and then click Submit
      5. Connect the message manifest method to the exit point, as shown in the following figure:
        Screenshot showing the use of message manifest method in the automation.
      6. On the toolbar, click Save to save the changes to the automation.

      Confirm your work

      1. In Project Explorer, click the ProcessDisputeTx automation.
      2. On the upper-right corner of Pega Robot Studio, click the Test button to run the automation test.
      3. In the Testing automation dialog box, enter input parameters: 
        1. In the customerNo field, enter 1234500078963456.
        2. In the transactionId field, enter 2535.
        3. In the txnAmount field, enter 39.57.
        4. In the txnDescription field, enter Gas.
      4. On the Testing automation dialog box, click Test to run the automation. Confirm that the Pega Robot Studio dialog box is displayed. 
        Screenshot showing the verification step, where the Pega Robot Studion message box is displayed.
      5. In the dialog box, click Ok. When automation completes, a Test complete dialog box is displayed.
      6. On the Test complete dialog box, verify that the automation ends with the Success message in the Exit point section, and that the Result variable is True
        Screenshot showing a Test compete dialog box with the test status.
      7. Click Done to finish the automation test. 
      8. Display the BankerInsight application.
      9. Verify that Txn DI, Amount, and Description fields have the same values as you entered in the step 3.
      10. Verify that the Dispute Result is set to Success.
        Screenshot showing the verification step in BankerInsight application.
      11. Close the BankerInsight application.
      12. On the upper-right corner of Pega Robot Studio, click the Test button to run another automation test.
      13. In the Testing automation dialog box, enter input parameters:
        1. In the customerNo field, enter 1234500078963456.
        2. In the transactionId, txnAmount, and txnDescription fields, enter 1 to run the test for a non-existing transaction. 
          Screenshot showing the Testing automation dialog box with test input parameters.
      14.  On the Testing automation dialog box, click Test to run the automation.
      15. Confirm that the Message manifest error message is correctly displayed. 
        Screenhot showing the Message manifest dialog box with the error details.
      16.  In the dialog box, click Ok. When automation completes, a Test complete dialog box is displayed.
      17. On the Test complete dialog box, verify that the automation ends with the False message in the Exit point section, the Result variable is False, and that the msgDetails parameter equals BI005
        Screenshot showing a Test compete dialog box with the test status.
      18.  Click Done to finish the automation test. 

      This Challenge is to practice what you learned in the following Module:


      Available in the following mission:

      If you are having problems with your training, please review the Pega Academy Support FAQs.

      Did you find this content helpful?

      Want to help us improve this content?

      We'd prefer it if you saw us at our best.

      Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

      Close Deprecation Notice