Administer Flow Patterns

A payroll flow pattern links together a sequence of automatic payroll processes, reporting tasks, and manual tasks. When you submit a payroll flow, the flow is based on a predefined flow pattern or on a flow pattern that you've created.

When you create your own flow pattern, you've the option to copy a predefined flow and make edits to meet your company's business requirements. You can define parameter-binding rules to enter parameters that are common across multiple tasks, such as dates, only once on submission. When you submit the flow pattern, the parameter value is constant across all tasks within the generated flow. You must provide a unique name for the flow, such as Semi-Monthly Payroll_15-Sept-2022. This instance of a flow pattern is referred to as a flow. You can use the checklist to monitor the status of all tasks within the flow.

Let's discuss these scenarios where you can use the Flow Patterns Rest APIs:

Submit a Flow Pattern

Let's say that Charles Joseph is a payroll administrator, who wants to load a large number of element entries. He uses the Load Data from File flow pattern and submits his element entries file.

To submit a flow pattern:

  1. Query (GET) the flowPatterns resource using the query parameter FlowPattern (for example, /flowPatterns?q=FlowPattern="Load Data from File").
  2. Use the flowParameters child resource link and perform a GET operation. For example, use the URL in the format hcmRestApi/resources/11.13.18.05/flowPatterns/100100121294472/child/FlowParameters.
  3. Make a note of the flowparameterID that is displayed in a list of values format. Let's say the value is 100100121322881.
  4. Query (GET) the flowParameterValuesLOV REST resource using the finder findByWord (for example, /flowParameterValuesLOV?finder=findByWord;FlowParameterId=100100121322881). This lists all the formulas available.
  5. Restrict the GET operation to show results for a particular formula name.

    Let's say the formula name is MD SIMPLE PPM FF. For example, use the URL in the format hcmRestApi/resources/latest/flowParameterValuesLOV?finder=findByWord;FlowParameterId=100100121322881,SearchTerms=MD SIMPLE PPM FF,FilterAttributes=DisplayAttribute&onlyData=true. This GET operation provides us the formula ID or StorageAttribute, say 300100181568962, to be passed for the flowParameterId 100100121322881.

  6. To establish the sample payload for the POST operation for submitFlow, use these two parameters and their attribute values:
    • ContentId: UCMFA00058412

      flowParameterId: 100100121322883

    • StorageAttribute/Formula ID: 300100181568962

      flowParameterId: 100100121322881

    You can use any flowInstanceName of your choice.

  7. Verify the details returned in the response.

Example URL

Use this resource URL format.

POST
/hcmRestApi/resources/11.13.18.05/flowPatterns/100100121294472/action/submitFlow

Example Request

Here's an example of the request body in JSON format.

{
  "parameterIdValues": {
                          "100100121322883":"UCMFA00058412",
                          "100100121322881":"300100181568962"
                     },
  "flowInstanceName": "ABC_TC3"
}

Example Response

Here's an example of the response body in JSON format.

{
  "result": "300100579283871"
}

Review Flow Patterns

A number of flow patterns are submitted throughout the day as part of daily payroll processing. Our payroll administrator Charles would like to see the status of submitted payroll flow patterns to ensure that the records are processed correctly. Rather than reviewing the status of all the processes, he only wants to check those flows with a status of Completed or Errors.

To review the flow patterns that have a status of Completed or Errors:

  1. Query (GET) the flowInstances REST resource by using the findByStatus finder and the appropriate filter for Status.
  2. Verify the details returned in the response.

Example URL

Use this resource URL format.

GET
/hcmRestApi/resources/11.13.18.05/flowInstances?finder=findByStatus;Status=ERRORS

Example Response

Here's an example of the response body in JSON format.

{
            "FlowInstanceId": 300100201401572,
            "RootFlowInstanceId": null,
            "FlowName": "VK_Rates_Feb2019",
            "LegislativeDataGroupId": 300100114169025,
            "BaseFlowId": 300100071276309,
            "GroupStatus": "IS_ERROR",
            "IsExtract": null,
            "IsDataLoader": null,
            "TaskType": "PROCESS",
            "NumberOfTasks": null,
            "CompletedTasks": null,
            "CreatedBy": "abc.abc@example.com",
            "CreationDate": "2020-01-23T09:29:00+00:00",
            "RecurSchFormulaId": -1,
            "ScheduledDate": null,
            "ScheduleEndDate": null,
            "RecurringFlag": false,
            "Records": 20,
            "PayrollId": 300100201310239,
            "ProcessDate": null,
            "LastUpdatedBy": "abc.abc@example.com",
            "LastUpdateDate": "2020-01-23T09:29:27.009+00:00",
            "Status": "ERRORS"
}

Perform Rollback on a Task

Charles now wants to roll back the Calculate QuickPay flow which has a Completed status.

To perform a rollback action on a task within a checklist:

  1. Query (GET) the flowInstances resource for the payroll flow that's submitted using the query parameter FlowName (for example, /flowInstances?q=FlowName=BG_CALC_130122-1003c).
  2. From the response, use the checkLists child resource URL and perform a GET operation. For example, use the URL in the format /hcmRestApi/resources/11.13.18.05/flowInstances/300100631390165/child/checklists.
  3. Make a note of the links for the actions getAvailableActions and performAction. These will be in the formats /hcmRestApi/resources/11.13.18.05/flowInstances/300100631390165/child/checklists/300100631390168/action/getAvailableActions and /hcmRestApi/resources/11.13.18.05/flowInstances/300100631390165/child/checklists/300100631390168/action/performAction respectively.
  4. Use the action link for getAvailableActions and perform a POST operation.

    Note:

    You don't need to provide a request payload.
  5. Make a note of the available actions from the response. The actions available are:
    • "ORA_MARK_FOR_RETRY": "Mark for Retry"
    • "ORA_ROLLBACK": "Roll Back"
    • "ORA_CHANGE_OWNER": "Change Owner"
  6. Use the action link for performAction and perform a POST operation with the action ORA_ROLLBACK.
  7. Verify the details returned in the response.

Example URL

Use this resource URL format.

POST
/hcmRestApi/resources/11.13.18.05/flowInstances/300100631390165/child/checklists/300100631390168/action/performAction

Example Request

Here's an example of the request body in JSON format.

{
  "actionName":"ORA_ROLLBACK"
}

Example Response

Here's an example of the response body in JSON format.

{
  "result": "true"
 }