Creating a new work status in Pega Field Service
Create a new work status to be used in a work order case and verify that the work orders with the newly added work status is visible in the Pega Field Service Dispatcher portal. For example, if you add Exception-Deferred as the work status and then place it in under Deferred summary status.
Perform this task to create a new work status. The following task shows an example of creating a new Exception-Deferred work status:
Override the PopulateWOStatusExtended data transform in your application and add the new summary status:
In the navigation pane of Dev Studio, click
.Select the PopulateWOStatusExtended data transform with the Code-Pega-List class.
On the Definition tab, click Add and enter the following values in the Action, Target, Relation, and Source fields:
Override the SetDisplayStatus decision table and add the new summary status:
In the navigation pane of Dev Studio, click
.Select the SetDisplayStatus decision table with the PegaFSM-Data-Appointment class.
On the Table tab, enter the following values in the Conditions and Actions fields:
Override the SetSubStatusCode decision table and add the required work status:
In the navigation pane of Dev Studio, click
.Select the SetSubStatusCode decision table with the PegaFSM-Data-Event class.
On the Table tab, enter the following values in the Conditions and Actions fields:
Override the WorkOrderSubStatus property in your application and add the new work status to the work order status prompt list:
In the navigation pane of Dev Studio, click
.Select the WorkOrderSubStatus property with the Index-PegaFSM-Data-Appointment class.
In the Display and validation section, in the Table type list, select Prompt List.
In the Prompt values section, click Add and enter the following values in the Standard value and Prompt value fields:
Override the PopulateDisplayStatusSubStatusMapping data transform in your application and map the new work status.
In the navigation pane of Dev Studio, click
.Select the PopulateDisplayStatusSubStatusMapping data transform with the Code-Pega-List class.
On the Definition tab, click Add and enter the following values in the Action, Target, Relation, and Source fields:
Override the SetFWJobCountBySubStatus data transform and populate the count of the new work status:
In the navigation pane of Dev Studio, click
.Select the SetFWJobCountBySubStatus data transform with the Code-Pega-List class.
On the Definition tab, click Add and enter the following values in the Action, Target, Relation, and Source fields:
Override the DispatcherConstantsController section to add the work status to the enum:
In the navigation pane of Dev Studio, click
.Select the DispatcherConstantsController section.
On the HTML tab, add the following code to the existing HTML source after
window.subStatusEnum
:"DEFERRED": { "code": '<p:r n="D_FSM_WorkOrderStatuses.WorkStatus.DEFERRED" />', "label": '<p:r n="D_FSM_WorkOrderStatuses.WorkStatus.DEFERRED" />', "displayStatusCode": '<p:rn="D_FSM_WorkOrderStatuses.WorkStatusMap.DEFERRED" />' }
Action | Target | Relation | Source |
Set | .WorkStatus(DEFERRED) | equal to | "Exception-Deferred" |
Conditions | Actions |
D_FSM_WorkOrderStatuses.WorkStatus(DEFERRED) | D_FSM_WorkOrderStatuses.Statuskey(DEFERRED) |
Conditions | Actions |
D_FSM_WorkOrderStatuses.WorkStatus(DEFERRED) | "DEFERRED" |
Standard value | Prompt value |
DEFERRED | Exception-Deferred |
Action | Target | Relation | Source |
Set | .WorkStatusMap (DEFERRED) | equal to | "Exception-Deferred" |
Action | Target | Relation | Source |
When | @equalsIgnoreCase (Param.Status, D_FSM_WorkOrderStatuses .WorkStatus(DEFERRED)) | - | - |
Set | .DEFERRED | equal to | .pySummaryCount(1) |
Previous topic Configuring tour mileage display Next topic Creating a new summary status in Pega Field Service