Skip to main content

Manipulating application data in Dev Studio

3 Tâches

20 mins

Visible to: All users
Débutant
Pega Platform '23
Data Integration
Anglais

Scénario

To ensure that customers are billed for only the services provided, the program manager wants the application to display a list of the services performed by the service provider. The list must include the following information:

  • Name of the service performed
  • Unit cost of the service
  • Number of times the service was performed
  • Total cost for each service
  • Total cost of the services performed

On the Perform service flow, configure the CopySelectedServices Data Transform to copy services provided from a Service Case to an Assistance Request Case.

Note: For the purposes of this challenge, the Service Case Type contains one Stage. For simplicity, the Case does not have a Create Stage.

The following diagram displays the relationships of the Selected Services Embedded Data type in the Assistance Request Case Type, and the Services data relationship in the Service Case Type to the Services offered data type.

entity relationship diagram services offered

The following table provides the credentials you need to complete the challenge.

Role User name Password
Application Developer author@gogoroad pega123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

Vous devez initier votre votre propre instance Pega pour compléter ce Défi.

L'initialisation peut prendre jusqu'à 5 minutes, donc soyez patient.

Présentation du défi

Détail des tâches

1 Configure the Review service summary Step

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter author@gogoroad.
    2. In the Password field, enter pega123!.
  2. In the navigation pane of App Studio, click Case Types > Assistance Request to open the Assistance request Case Type.
  3. In the Assistance request Case Type, on the Workflow tab, click Review service summary to open the Step properties pane.
  4. In the Step properties pane to the right, click Configure View to display a dialog box.
  5. In the dialog box, click Add field to configure a new field.
  6. Create a multi-record data relationship named Selected services. In the Type list, select Embedded Data. In the Data object list, select Services offered. Click the List of records radio button to designate it as a multi-record data relationship. 
    selected-services
  7. Click Submit & add another to configure a new field.
  8. Create a currency calculated field named Invoiced total. In the Type list, select Currency.
  9. Expand the Advanced section and then select the This is a calculated field (read-only) check box.
  10. In the Calculation section, in the Function dropdown, select Sum of. In the Field dropdown, select Line total.
  11. Click Submit.
    Invoiced total field configuration
  12. In the Options for the Description, Quantity, Service, and Unit Cost fields, select Read-only.
    Review service summary
  13. Click Submit to record the new fields and return to the Workflow tab of the Case Life Cycle.
  14. Click Save to save your changes in the Case Life Cycle.

2 Configure the CopySelectedServices Data Transform

  1. In the navigation pane of App Studio, click Case Types > Service to open the Service Case Type.
  2. In the Perform service Process, click Configure Process.
  3. Click Open Process in Dev Studio to open the Perform service flow Rule in the flow canvas.
    Tip: Alternatively, in Dev Studio, in the App Explorer, expand Service > Process > Flow, and then select PerformService to open the Perform service flow Rule.
  4. On the flow canvas, right-click the Select services connector, and then select View Properties to display the Connector properties dialog box.
     
    Select services connector View properties
  5. In the Connector properties dialog box, in the Set properties area, select Apply Data Transform to add a Data Transform to the connector.
  6. In the Data Transform field, enter CopySelectedServices to name the Data Transform. 
    connector properties CopySelectedServices data transform
  7. To the right of the Data Transform field, click the Open icon to open the Create Data Transform tab.
  8. On the Create Data Transform tab, click Create and open to display a new Data Transform record.
  9. On the Definition tab of the Data Transform record, configure the CopySelectedServices Data Transform.
    1. On the Data Transform record, click the Pages & Classes tab to define the pyWorkCover page so that the Data Transform can resolve the Selected services property reference.
    2. In the Page name field, enter pyWorkCover as the name of the page to define.
    3. In the Class field, enter or select GoGo-GoGoRoad-Work-AssistanceRequest to define the context of the pyWorkCover page as the Assistance Request Case Type class. 
      page-classes
       
    4. On the Data Transform record, in the Action list, select For Each Page In to repeat over the items in a list. A second, indented row labeled 1.1 is displayed on the record.
    5. In the row labeled 1, in the Target field, enter or select .Services to repeat over the items in the Services list.
    6. In the Source column, select the Also use each page as source context check box to use the Services page as the source context to resolve property references.
    7. In the row labeled 1.1, in the Actions list, select When to configure the Condition for selecting a row. A third, indented row labeled 1.1.1 is displayed on the record.
    8. In the row labeled 1.1, in the Target field, enter .Quantity>0 to only select rows with a quantity greater than zero.
    9. In the row labeled 1.1.1, from the Actions list, select Append to to append the contents of the selected row to a different list.
    10. In the row labeled 1.1.1, in the Target field, enter pyWorkCover.SelectedServices to copy the contents of the selected row to the Selected Services data relationship in the Assistance request parent Case.
    11. In the row labeled 1.1.1, from the Relation list, select current source page to copy the contents of the selected row in the Services data relationship in the Service Case. 
      data-transform
    12. Click Save to complete the configuration of the Data Transform.
  10. Click the PerformService tab to return to the Perform service flow record.
  11. In the Connector properties dialog box, click Submit to complete the configuration of the Select services connector that runs the CopySelectedServices Data Transform.
  12. Click Save to complete the configuration of the Perform service flow record.

3 Set default property values for service quantity

  1. From the App Explorer, expand Service > Data Model > Data Transform, and then click pyDefault to open the pyDefault Data Transform.
    Note: If you do not see pyDefault, refresh the App Explorer by clicking Options > Refresh App Explorer.
  2. In the Pages & Classes tab, enter pyWorkCover for the Page name field and GoGo-GoGoRoad-Work-AssistanceRequest for the Class field.
    pagename
  3. In the Definition tab, click Add a row.
  4. In the Action field, select For Each Page In.
  5. In the Target field, enter or select .Services.
  6. Check the box Also use each page as source context.
  7. In the child step's Action field, select Set.
  8. In the Target field, enter or select .Quantity.
  9. In the Source field, enter 0.
    pydefault-2
  10. Click Save to save your changes to the new version of pyDefault.

Vérifier votre travail

  1. Click Create > New > Assistance Request
  2. In the Enter customer information form, select [email protected] as the Account ID.
  3. Advance the Case to the Select services View and confirm the default values in each field in the Quantity row is 0.
  4. Enter the quantities provided in the following image and verify that the total cost is $210.00. 
    services-screen
  5. Click Submit to complete the Select services Assignment and resolve the Service Case. The Review service summary View is displayed.
  6. On the Review service summary View, verify that the Selected services table displays the three rows filled out in the Service Case and that the value of the Invoice total field is $210.00.
    Note: In a real-life implementation, ensure that the list of selected services in the Assistance Request Case is read-only and restricts users from adding or removing items. You can remove the Add item and Delete controls by editing the Section Rule that displays the list, which is outside the scope of this challenge.
    reviewServices
Note: The empty first row in the table is a result of the Selected services list initialization. You can remove the empty first row by deleting the .SelectedServices(1).pyLabel created by default in the pySetFieldDefaults Data Transform, which is outside the scope of this challenge.

Ce défi vise à appliquer ce que vous avez appris dans le Module suivant :


Disponible dans les missions suivantes :

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