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
- Review flow patterns with a status of Completed or Errors
- Perform rollback on a task within a checklist
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:
- Query (GET) the
flowPatterns
resource using the query parameterFlowPattern
(for example,/flowPatterns?q=FlowPattern="Load Data from File"
). - Use the
flowParameters
child resource link and perform a GET operation. For example, use the URL in the formathcmRestApi/resources/11.13.18.05/flowPatterns/100100121294472/child/FlowParameters
. - Make a note of the
flowparameterID
that is displayed in a list of values format. Let's say the value is 100100121322881. - Query (GET) the
flowParameterValuesLOV
REST resource using the finderfindByWord
(for example,/flowParameterValuesLOV?finder=findByWord;FlowParameterId=100100121322881
). This lists all the formulas available. - 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 orStorageAttribute
, say 300100181568962, to be passed for theflowParameterId
100100121322881. - To establish the sample payload for the POST operation for
submitFlow
, use these two parameters and their attribute values:ContentId
: UCMFA00058412flowParameterId
: 100100121322883StorageAttribute
/Formula ID: 300100181568962flowParameterId
: 100100121322881
You can use any
flowInstanceName
of your choice. - 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
:
- Query (GET) the
flowInstances
REST resource by using thefindByStatus
finder and the appropriate filter forStatus
. - 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:
- Query (GET) the
flowInstances
resource for the payroll flow that's submitted using the query parameterFlowName
(for example,/flowInstances?q=FlowName=BG_CALC_130122-1003c
). - 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
. - Make a note of the links for the actions
getAvailableActions
andperformAction
. 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. - Use the action link for
getAvailableActions
and perform a POST operation.Note:
You don't need to provide a request payload. - 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"
- Use the action link for
performAction
and perform a POST operation with the actionORA_ROLLBACK
. - 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"
}