Standardwerte für Eigenschaften festlegen
4 Aufgaben
10 Min.
Szenario
Der Programm-Manager von GoGoRoad möchte sicherstellen, dass im Callcenter ausreichend Personal vorhanden ist, um Serviceverzögerungen zu vermeiden. Der Projektmanager möchte zu diesem Zweck einen Bericht erstellen, in dem die Anzahl der Kundenanfragen nach Wochentag erfasst wird. Um die Anforderung in Bezug auf die Berichterstellung zu erfüllen, müssen Sie eine Datentransformation zur Bestimmung des Wochentags für einen bestimmten .pxCreateDateTime-Wert erstellen. Rufen Sie dann diese Datentransformation über pyDefault auf, um jedes Mal, wenn ein Kunde oder Kundenbetreuer einen Case mit einer Unterstützungsanfrage erstellt, den Wochentag zum Case hinzuzufügen.
In der folgenden Tabelle finden Sie die Anmeldedaten, die Sie zur Durchführung der Challenge benötigen.
Rolle | Benutzer ID | Kennwort |
---|---|---|
Application Developer | author@gogoroad | pega123! |
Challenge-Schritte
Genaue Übungsschritte
1 Create properties for the Service Day and Service Day of Week
- In Dev Studio, from the Navigation pane, click App.
- Expand AssistanceRequest > Data Model.
- Right-click Property, and then click Create.
- In the Label field, enter Service Day.
- Click Create and open.
- To the right of Text, click change to modify the property type.
- Click Integer to change the property type to Integer.
- Click Save to save the Service Day property.
- Repeat steps 3-5 to create a property named Service Day of Week. Set the Property type to Text.
- Click Save to save the Service Day of Week property.
2 Create the Set Day of Week data transform
- From the App Explorer, expand AssistanceRequest > Data Model.
- Right-click Data Transform, and then click Create.
- In the Label field, enter Set Day of Week.
- Click Create and open.
- In the first line of the data transform, set .ServiceDay equal to @weekday(.pxCreateDateTime) to calculate an integer value for each day of the week.
- Click Add a row.
- In the second line of the data transform, set .ServiceDayOfWeek equal to @if(.ServiceDay=1,"Sunday", @if(.ServiceDay=2,"Monday", @if(.ServiceDay=3,"Tuesday", @if(.ServiceDay=4,"Wednesday", @if(.ServiceDay=5, "Thursday", @if(.ServiceDay=6, "Friday","Saturday")))))) to associate each Service Day integer value with a day of the week.
- Click Save.
3 Call Set Day of Week data transform in .pyDefault
- From the App Explorer, expand AssistanceRequest > Data Model > Data Transform, and then click pyDefault to open the pyDefault data transform.
Hinweis: If you do not see pyDefault, refresh the App Explorer by clicking Options > Refresh App Explorer.
- Click Add a row.
- From the Action drop-down, select Apply Data Transform.
- In the Target field, enter or select SetDayOfWeek.
- Click Save to save your changes to the new version of pyDefault.
4 Confirm your work
- From the Create menu, create a new Assistance Request case.
- Advance past the Create view.
- Click the Clipboard to open the Clipboard tool.
- Ensure that the selected Thread matches the Case ID of the current case instance.
- Click pyWorkPage.
- Ensure that the ServiceDayOfWeek value matches the current day of the week, which is the day the case was created.
In der folgenden Mission verfügbar:
Möchten Sie uns dabei helfen, diesen Inhalt zu verbessern?