Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Creating a new work status in Pega Field Service

Updated on October 6, 2020

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.

Before you begin: Create a new summary status, for example, Deferred, as described in Creating a new summary status in Pega Field Service. Skip if you reuse an existing 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:

  1. Override the PopulateWOStatusExtended data transform in your application and add the new summary status:

    1. In the navigation pane of Dev Studio, click RecordsData ModelData Transform.

    2. Select the PopulateWOStatusExtended data transform with the Code-Pega-List class.

    3. On the Definition tab, click Add and enter the following values in the Action, Target, Relation, and Source fields:

  2. ActionTargetRelationSource
    Set.WorkStatus(DEFERRED)equal to"Exception-Deferred"
  3. Override the SetDisplayStatus decision table and add the new summary status:

    1. In the navigation pane of Dev Studio, click RecordsDecisionDecision Table.

    2. Select the SetDisplayStatus decision table with the PegaFSM-Data-Appointment class.

    3. On the Table tab, enter the following values in the Conditions and Actions fields:

  4. ConditionsActions
    D_FSM_WorkOrderStatuses.WorkStatus(DEFERRED)D_FSM_WorkOrderStatuses.Statuskey(DEFERRED)
  5. Override the SetSubStatusCode decision table and add the required work status:

    1. In the navigation pane of Dev Studio, click RecordsDecisionDecision Table.

    2. Select the SetSubStatusCode decision table with the PegaFSM-Data-Event class.

    3. On the Table tab, enter the following values in the Conditions and Actions fields:

  6. ConditionsActions
    D_FSM_WorkOrderStatuses.WorkStatus(DEFERRED)"DEFERRED"
  7. Override the WorkOrderSubStatus property in your application and add the new work status to the work order status prompt list:

    1. In the navigation pane of Dev Studio, click RecordsData ModelProperty.

    2. Select the WorkOrderSubStatus property with the Index-PegaFSM-Data-Appointment class.

    3. In the Display and validation section, in the Table type list, select Prompt List.

    4. In the Prompt values section, click Add and enter the following values in the Standard value and Prompt value fields:

  8. Standard valuePrompt value
    DEFERREDException-Deferred
  9. Override the PopulateDisplayStatusSubStatusMapping data transform in your application and map the new work status.

    1. In the navigation pane of Dev Studio, click RecordsData ModelData Transform.

    2. Select the PopulateDisplayStatusSubStatusMapping data transform with the Code-Pega-List class.

    3. On the Definition tab, click Add and enter the following values in the Action, Target, Relation, and Source fields:

  10. ActionTargetRelationSource
    Set

    .WorkStatusMap

    (DEFERRED)

    equal to"Exception-Deferred"
  11. Override the SetFWJobCountBySubStatus data transform and populate the count of the new work status:

    1. In the navigation pane of Dev Studio, click RecordsData ModelData Transform.

    2. Select the SetFWJobCountBySubStatus data transform with the Code-Pega-List class.

    3. On the Definition tab, click Add and enter the following values in the Action, Target, Relation, and Source fields:

  12. ActionTargetRelationSource
    When

    @equalsIgnoreCase

    (Param.Status,

    D_FSM_WorkOrderStatuses

    .WorkStatus(DEFERRED))

    --
    Set.DEFERREDequal to.pySummaryCount(1)
  13. Override the DispatcherConstantsController section to add the work status to the enum:

    1. In the navigation pane of Dev Studio, click RecordsUser InterfaceSection.

    2. Select the DispatcherConstantsController section.

    3. 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" />' }

Create a new summary status as described in Creating a new summary status in Pega Field Service.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

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.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us