Generate Load and Report Data Using Custom Payroll Flow Pattern
Generate Load and Report Data Using Custom Payroll Flow Pattern
Introduction
Some of us might be aware of the various different ways to loading data into Oracle HCM Cloud
which are:
1) HCM Data Loader
2) HCM Spreadsheet Data Loader
3) Via Web Service Call (Webservice / REST)
4) Data Entry from UI
And also “Inbound Interface HCM Extract”.
Inbound Interface HCM Extract which is also sometime referred as Loopback Interface is a
process where Data is generated by “HCM Extracts” and after making some modification on the
generated data (applying transformation / business logic on eText Template) is loaded back into the
application (and all this with mere submission of the “HCM Extracts”).
So far so good but many a times one would like to have data generated via other data source (say BIP
, OTBI etc) and still intend to load data into application back. For such scenarios we can use this
method which I am going to refer from now on as “Generate and Load Data”.
“Generate and Load Data” sounds similar to “Import and Load Data” and yes it is a little bit and
that is why I have try to give such a name, but before proceeding further I would explain what is
meant by “Generate and Load Data”.
Generate Load and Report Data
No, this is not a delivered task/flow in the Oracle HCM Cloud Application (at least not till Release 13
20B) but is being referred to a custom payroll flow pattern which will comprise of the following flow-
tasks:
1) Generate Data
2) Generate HCM Data Loader File
3) Initiate HCM Data Loader
4) Trigger HDL Error Report
Generate Data
Generate Data is a custom payroll task (after renaming “Run BI Publisher Report”). This particular
task runs a BIP Report which generates a TXT file and loads the same into Web Center Content
(UCM Server) by using Bursting Option.
Generate HCM Data Loader File
This flow task is a sub-task of “Load Data From File” which takes Content ID (yes the file must be
available in UCM) , Transformation Formula (Fast Formula of HCM Data Loader Type) and
Process Configuration Group (required to submit any process flow) and generates a new File and
places the same in the UCM Server
Initiate Data Loader
This flow task is also a sub-task of “Load Data From File” which take the output generated by
“Generate HCM Data Loader File” and then initiates the Data Loader process
Trigger HDL Error Report
Generate Data is a custom payroll task (after renaming “Run BI Publisher Report”). This particular
task runs a HDL Error Report (BIP Report which generates a XLSX file).
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
So this is a brief description about the various tasks which would be used while creating the Custom
Payroll Flow Task namely “Generate and Load Data”.
We would need to perform below steps prior to creating “Generate and Load Data”
1) Create BIP Report which will generate TXT File and place the same in UCM Server using
BIP Bursting
2) Create a “HCM Data Loader” type Fast Formula.
So, without further ado let’s get started.
Creating BIP Report
For this example we will create a simple BIP report which will generate the data fields required for
PersonAccrualDetail Business Object.
Details about the data fields is as below
We would need to create a Data Model which will have 2 Data Sets and 1 Bursting Query
FlowTask_ds
This is the master data set (primarily used to associate the BIP Report run with the Payroll Flow task
we are going to generate in later part). This data set returns the PAY_REQUEST CALL_ID which is
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
used to allow the BIP report to Burst to a single file. In addition, the CALL_ID is used to uniquely
identify the BIP report once it is uploaded to UCM.
GenerateData_ds
This is the data set which would generate the data which will be used for Data Load. For this example
it would fetch the Adjustment Details which would be loaded to a specific plan
SQL for Generate_ds
select 'ADJOTH' ACCRUALTYPE,
'SICK_ADJ' ADJUSTMENTREASON,
papf.person_number PERSONNUMBER,
aapft.name PLANNAME,
7 VALUE,
(select distinct paam1.assignment_number
from per_all_assignments_m paam1
where paam1.assignment_type = 'ET'
and paam1.primary_flag = 'N'
and trunc(ppos.date_start) between paam1.effective_start_date and
paam1.effective_end_date
and paam1.period_of_service_id = ppos.period_of_service_id
and paam1.person_id = papf.person_id
and rownum = 1
) WORKTERMSNUMBER,
to_char(SYSDATE,'YYYY/MM/DD') PROCDDATE,
'HRC_LEGACY' SOURCESYSTEMOWNER,
papf.person_number || '_' || upper(aapft.name) || '_' || 'SICK_ADJ' || '_' ||
TO_CHAR(SYSDATE,'YYYYMMDD') SOURCESYSTEMID
from per_all_people_f papf,
per_periods_of_service ppos,
anc_absence_plans_f_tl aapft,
per_all_assignments_m paam,
anc_per_plan_enrollment appe
where papf.person_id = paam.person_id
and papf.person_id = ppos.person_id
and ppos.period_of_service_id = paam.period_of_service_id
and appe.prd_of_svc_id = paam.period_of_service_id
and papf.person_id = appe.person_id
AND appe.plan_id = aapft.absence_plan_id
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
BurstToUCM
The bursting query will result in a file being sent to UCM. The CONTENT_ID of the file will be of
the form:
'PersonAccrualDetail'||to_char(CALL_ID) where CALL_ID is unique to the specific instance of the
process.
,pay_flow_tasks_vl ft
,pay_requests r
where ft.flow_task_name = 'Generate Data'
and ft.base_flow_task_id = fti.base_flow_task_id
and fti.flow_task_instance_id = r.flow_task_instance_id
and r.call_type= 'ESS'
and fti.flow_task_instance_id = :TASK_INSTANCE_ID
union
select 1234
from dual
where :TASK_INSTANCE_ID is null
)
And once we upload the template and try to run the report data should appear as below:
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
Next, we will need to create a Fast Formula of “HCM Data Loader” Type.
Create Transformation Formula of HCM Data Loader Type
As a next step we would need to create a Fast Formula which will take the above file and convert it in
into corresponding HDL File. (GENERATE_PERSONACCRUALENTRY_HDL_FROM_TXT)
IF OPERATION='FILETYPE' THEN
OUTPUTVALUE='DELIMITED'
ELSE IF OPERATION='DELIMITER' THEN
OUTPUTVALUE='|'
ELSE IF OPERATION='READ' THEN
OUTPUTVALUE='NONE'
ELSE IF OPERATION = 'NUMBEROFBUSINESSOBJECTS' THEN
(
OUTPUTVALUE = '1'
RETURN OUTPUTVALUE
)
ELSE IF OPERATION = 'METADATALINEINFORMATION' THEN
(
METADATA1[1] = 'PersonAccrualDetail' /*FileName*/ /*Reserved*/
METADATA1[2] = 'PersonAccrualDetail' /*FileDiscriminator*/ /*Reserved*/
METADATA1[3] = 'AccrualType'
METADATA1[4] = 'AdjustmentReason'
METADATA1[5] = 'PersonNumber'
METADATA1[6] = 'PlanName'
METADATA1[7] = 'Value'
METADATA1[8] = 'WorkTermsNumber'
METADATA1[9] = 'ProcdDate'
METADATA1[10] = 'SourceSystemOwner'
METADATA1[11] = 'SourceSystemId'
RETURN METADATA1
)
WorkTermsNumber = trim(POSITION6)
ProcdDate = trim(POSITION7)
SourceSystemOwner = trim(POSITION8)
SourceSystemId = trim(POSITION9)
RETURN
BusinessOperation,FileName,FileDiscriminator,AccrualType,AdjustmentReason,PersonNumber,Pl
anName,Value,WorkTermsNumber,ProcdDate,SourceSystemOwner,SourceSystemId,LINEREPEA
T,LINEREPEATNO
)
)
)
ELSE
OUTPUTVALUE='NONE'
RETURN OUTPUTVALUE
/* End Formula Text */
Now we will start configuring the Custom Payroll Flow Pattern named “Generate and Load Data”
Creating Custom Payroll Flow Pattern “Generate Load and Report Data”
Navigation-> My Client Groups -> Payroll ->(Administration) Payroll Flow Patterns -> Copy (Load
Data from File)
Once we copy the flow from “Load Data From File” we should give a new name to the custom flow
(“Generate Load and Report Data”) and once done we should add a new task name “Run BI Publisher
Report” and rename to “Generate Data” as shown
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
We will now need to set/edit the properties of “Generate Data” Task (once you click on the “Go To
Task” you would be taken to the parameters page. The details of the parameters are mentioned below
Nest we would be required to change the Parameter properties of “Content ID” parameter of
“Generate Data Loader File” Task
Old Value
Name Parameter Basis Value
Content Id Bind To Flow Content Id
New Value
Name Parameter Basis Value
Content Id Post SQL Bind select 'PersonAccrualDetail'||to_char(CALL_ID) from
pay_flow_task_instances fti,pay_flow_tasks_vl
ft,pay_requests r where ft.flow_task_name = 'Generate
Data' and ft.base_flow_task_id = fti.base_flow_task_id and
fti.flow_task_instance_id = r.flow_task_instance_id and
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
We will also need to change the properties of “Content Id” parameter of payroll flow
Old Value
*Flow Parameter Display Parameter Basis Basis Value
Content Id Mandatory
New Value
*Flow Parameter Display Parameter Basis Basis Value
Content Id No Post SQL Bind select 'PersonAccrualDetail'
||to_char(r.call_id)
from pay_flow_task_instances fti,
pay_flow_tasks_vl ft,
pay_requests r
where ft.flow_task_name = 'Generate
Data'
and ft.base_flow_task_id =
fti.base_flow_task_id
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
and fti.flow_task_instance_id =
r.flow_task_instance_id
and r.call_type= 'ESS'
and fti.flow_instance_id =
:pFlowInstanceId
We would also need to make sure that the “First Argument” parameter for “Trigger HDL Error
Report” is set to “Generate Data Loader File, Submit, HDL Content ID”
Now as a last part of the setup we should check that the “Enable Bursting” Flag under Report-
>Properties (of Generate Data Report) is set
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
We would also need to enable bursting for the HDL Error Report
FROM fusion.hrc_dl_message_lines l
, fusion.hrc_dl_data_set_bus_objs bo
, fusion.hrc_dl_data_sets ds
, fusion.hrc_dl_logical_lines ll
, fusion.hrc_dl_file_rows fr
, fusion.hrc_dl_file_lines fl
WHERE l.message_source_table_name = 'HRC_DL_LOGICAL_LINES'
AND bo.data_set_bus_obj_id = l.data_set_bus_obj_id
AND ds.data_set_id = bo.data_set_id
AND ll.logical_line_id = l.message_source_line_id
AND fr.logical_line_id = ll.logical_line_id
AND fl.line_id = fr.line_id
AND (ds.ucm_content_id = :p_ucm_content_id
OR ds.data_set_name = :p_data_set_name)
--
UNION
--
SELECT '001' report_key,fr.key_source_owner, fr.key_source_id, l.msg_text
,SUBSTR(fl.TEXT,INSTR(fl.TEXT,'|',1,2)+1,INSTR(fl.TEXT,'|',1,3)-INSTR(fl.TEXT,'|',1,2)-1)
"CONTEXT"
,fl.TEXT
FROM fusion.hrc_dl_message_lines l
, fusion.hrc_dl_data_set_bus_objs bo
, fusion.hrc_dl_data_sets ds
, fusion.hrc_dl_file_rows fr
, fusion.hrc_dl_file_lines fl
WHERE l.message_source_table_name = 'HRC_DL_FILE_ROWS'
AND bo.data_set_bus_obj_id = l.data_set_bus_obj_id
AND ds.data_set_id = bo.data_set_id
AND fr.row_id = l.message_source_line_id
AND fl.line_id = fr.line_id
AND (ds.ucm_content_id = :p_ucm_content_id
OR ds.data_set_name = :p_data_set_name)
As a last step please ensure that the *LDG Required Attribute is set to optional (By default it is set to
“Yes”. If it is so then the same should be changed as shown below:
Now, that all setups are done we should try running the payroll flow and verify results
Verification
We will submit the newly created Custom Payroll Flow Pattern.
Navigation: My Client Groups -> Payroll-> (Flow Submission and Results) Submit a Flow ->
Generate and Load Data
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
If we click on the “Generate Data” task we will find some details of the ESS process id associated
with the task.
And if we click on the file content detail we could see the content of data file
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
Also we will check the “Import and Load Data” page and we will see that the Data Set name will be
same as payroll flow instance name (GLR01 in this example)
And also, we can quickly check output of “Trigger HDL Error Report” which is an xlsx file
As a last step we will navigate to My Client Groups -> Person Management -> Search for a Person
(310 for this example) -> Absence -> Manage Absence Records
And Then check under vacation plan we will see that an adjustment entry with accrual value of 5 has
been loaded with effective date as 30/07/2020
Generate Load and Report Data Using Custom Payroll Flow Pattern
By: Ashish Harbhajanka
Conclusion
So, this is how we can make use of BIP (Bursting Feature) to deliver data to UCM Server which can
then be loaded into HCM Application by using of Generate Data Loader Task.
We can summarize the entire step in one image:
One can make the “Generate and Load Data” task more generic by adding two new flow parameters
namely report name and report path and use same flow to load different types of data, and with that
we have come to the end of this post.
Hope this was a good read.
Thanks for your time and have a nice day ahead.