Automating Payroll Batch Loader

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

An Oracle White Paper

June 2014

Automating Payroll Batch Loader


Draft 1
Automating Payroll Batch Loader

Introduction ....................................................................................... 1
Solution Overview ............................................................................. 3
FlowActionsService Overview........................................................ 3
Creating a Payroll Batch .................................................................... 4
Invoking the Load Batch From File flow ......................................... 4
By-passing the manual Upload File step ........................................ 5
Transferring a Payroll Batch .............................................................. 6
Creating Custom Transfer Batch Flow ........................................... 6
Invoking Transfer Batch Flow ...................................................... 10
Conclusion ...................................................................................... 11
Sections to be added in later versions of the document ............... 11
Automating Payroll Batch Loader

Introduction

Payroll Batch Loader is a tool that allows a customer to upload a variety of data objects,
primarily those used in the payroll product. The mechanism involves creating a batch in the
Payroll Batch Loader staging tables followed by a subsequent step to transfer the batch to
Fusion. The Payroll Flow UI is used to invoke the different steps for creating the payroll batch
and transferring the batch.

The seeded payroll flows what are used are as follows:

 Create Batch – this allows the user to generate a spreadsheet which they complete and then
re-import to create the payroll batch

 Load Batch from File – a predefined data file is selected and is processed through a
“transformation” formula resulting in a payroll batch being created

 Transfer Batch – moves the data from the payroll batch tables to Fusion by executing code
that is specific to the type of object being loaded.

All of the steps described above require manual intervention through the Payroll Flow UI, to
invoke the initial processes and in some cases to complete subsequent steps.

Customers who are trying to integrate their systems using automated orchestration have a
need to minimize the number of steps that are performed manually, and it is therefore
necessary to ensure that Payroll Batch Loader can be automated.

It is possible to invoke Payroll Flows using the FlowActionsService external web service and
this paper discusses how this can be applied to the automation of Payroll Batch Loader.

1
Automating Payroll Batch Loader

This document should be used in conjunction with the Loading Data using Payroll Batch
Loader - Technical Essay (Doc ID 1590004.1).

2
Automating Payroll Batch Loader

Solution Overview
The solution outlined in this document comprises 2 parts; Loading the batch to the stage tables and
Transferring the batch to Fusion. The solution makes use of some of the seeded Payroll Flow
components and in other parts it copies and configures the seeded component.
A pre-requisite to the process is to place a csv or data file into UCM that contains the data to be loaded
into Fusion.
A web service is then called to invoke the Load Batch From File payroll flow.
A 2nd call to the web service ensures that a step that would otherwise be manual is automated by
indicating that the step is complete .
The process reads the data file and creates the batch in a set of staging tables, setting its status to
Unprocessed.
Another web service call invokes the Transfer mechanism which moves the data from the staging
tables to Fusion by calling product specific APIs.
At each stage of the flow the status can be monitored using a service call, an example of which is given
below.
Finally, if the status of the transfer is not “Transferred” (i.e. successfully completed) then any errors
can be downloaded using a BI report that is invoked using a BI service.

FlowActionsService Overview
The FlowActionsService provides a set of methods that allow Payroll Flows to be invoked and
managed from outside of Fusion. It allows customers to automate the processing of any Payroll Flows
including Payroll Batch Loader, HCM Extract and Payroll Processes etc.
The key methods that are used in this payroll batch loader solution are as follows:

TABLE 1. LOAD BATCH FROM FILE STEPS

METHOD NAME DESCRIPTION

submitFlow Initial submission of the Payroll Flow – creates the Flow Instance with a given name

getFlowTaskInstanceStatus Retrieve the status of the Flow

performAction

All Payroll Flows have a set of common parameters as follows:

TABLE 3. FLOW ACTIONS SERVICE COMMON PARAMETERS

PARAMETER NAME DESCRIPTION

3
Automating Payroll Batch Loader

flowName The name of the payroll flow

legislativeDataGroup LDG into which the data will be loaded

flowInstanceName Unique identifier of the flow to be invoked

recurringFlag Set to false

In addition each Payroll Flow may have additional flow specific parameters that will be passed to the
FlowActionsService as Name Value pairs.

Creating a Payroll Batch


The pre-requisite for creating a batch using the service approach is to have uploaded a csv or data file
into UCM either manually or more likely through automation using the UCM upload tool or service.
This will generate a Content Id which is one of the parameters to the flow.
In addition if the payroll batch is to use a Transformation Formula to convert the incoming data into
the correct format for further processing, the ID value of the transformation formula needs to be
passed in the payload. This ID value can be derived using the following SQL:
select f.formula_id,f.formula_name
from ff_formulas_f f
, ff_formula_types_vl ft
where ft.formula_type_id = f.formula_type_id
and base_formula_type_name = 'Batch Loader';

Invoking the Load Batch From File flow


The “Load Batch From Flow” process is invoked using the FlowActionsService using the following
parameters:

TABLE 3. LOAD BATCH FROM FILE SERVICE INVOCATION

SERVICE hcmProcFlowCoreController/FlowActionsService

METHOD submitFlow

PARAMETER NAME DESCRIPTION

flowName Load Batch from File

legislativeDataGroup LDG into which the data will be loaded

flowInstanceName Unique identifier of the flow to be invoked

4
Automating Payroll Batch Loader

recurringFlag false

PARAMETER NAME VALUE PAIRS

PARAMETER NAME PARAMETER VALUE

Batch The name of the payroll batch when it is created – used in next steps

Transformation Formula The Formula Id of the formula used to transform the data ready for loading into the payroll batch
staging tables

Content Id The identifier of the csv or data file in UCM

Once initiated the Load Batch From File follows the predefined steps:

TABLE 1. LOAD BATCH FROM FILE STEPS

PARAMETER NAME DESCRIPTION

Upload File In the UI this allows manual upload of the csv or data file

Load Batch Automatic processing of the data file to create the batch

Verify Batch Manual verification that the batch was created correctly

The 1st step in this list is a manual step that is used in the UI flow, allowing the user to upload the data
vile through the UI. In the service invocation this step can be by-passed.

By-passing the manual Upload File step


When the Load Batch From File is run through the Payroll Flow UI the process stops and waits for
the user to manually upload a file into UCM and to confirm that the process can continue. When the
file is loaded to UCM the Content Id is populated in the flow instance parameters so that the Load
Batch can complete.
Even when the Load Batch From File is invoked in an automated manner the process still stops at this
point and so it is necessary to signal to the flow instance that it can continue as it already has the UCM
Content Id. To achieve this a second call to FlowActionsService is made as follows:

TABLE 4. BYPASSING UPLOAD FILE STEP

SERVICE hcmProcFlowCoreController/FlowActionsService

METHOD performAction

PARAMETER NAME DESCRIPTION

legislativeDataGroup LDG as specified when invoking the flow

5
Automating Payroll Batch Loader

flowInstanceName Unique identifier of the flow as specified when invoking the flow

flowTaskInstanceName Upload File

actionName Initialize

The subsequent step is processed automatically before again stopping at the Verify Batch stage. In
testing it wasn’t possible to get this task to complete so it can either be ignored or the Load Batch
From File flow can be copied and the Verify Batch task removed.

Transferring a Payroll Batch


Once the payroll batch has been created in the staging tables it is ready for transfer to Fusion. This step
can also be invoked using the FlowActionsService, however in this case it is necessary to copy the
seeded Transfer Batch flow and to modify the copy. The steps to do this are listed below.

Creating Custom Transfer Batch Flow


The seeded Transfer Batch flow does not have the capacity to derive the Batch Id from the Batch
parameter when processed via the service call (this only works when the process is performed in the
UI). Therefore an additional parameter has to be added to the flow to derive the Batch Id.
Rather than modifying the seeded Transfer Batch Flow it should be copied and modifications made to
the copy. The following screenshots show the steps that should be performed.

Figure 1. Copy Seeded Transfer Batch Flow Pattern

6
Automating Payroll Batch Loader

Figure 1. Create new Flow Pattern as a copy

Figure 1. Query the new Flow Pattern and Edit

Figure 1. Click on Transfer Batch line and hit Edit Buttons to into Edit Step

7
Automating Payroll Batch Loader

Figure 1. For the Batch parameter enter the highlighted values, then Next, Next, Submit, Save

Figure 1. Click on Parameters Tab, add a new “BatchName” parameter

Add the following attribute values

ATTRIBUTE NAME VALUE

Flow Parameter BatchName

Use for Searches No

Display Mandatory

8
Automating Payroll Batch Loader

Display Format Text

Sequence 0

Usage Input Parameter

Save the new parameter.


The purpose of this parameter is to accept the name of the payroll batch that should be transferred to
Fusion. It will be used to derive the BatchId which will be stored in the original “Batch” parameter.
The original “Batch” parameter needs to modified to include a SQL statement that can derive the
BatchId. This statement is as follows:
select to_char(batch_id) from pay_batch_headers
where batch_name = ':{BatchName}'

In this SQL statement the bind variable :BatchName parameter needs correspond to the stored name of
the new parameter created above. This name can be derived using the following SQL:
select base_flow_parameter_name
from pay_flow_parameters_vl
where base_flow_parameter_name like '%BatchName'
and base_flow_id in
(select base_flow_id
from PAY_FLOWS_vl
where base_flow_name = 'JR Transfer Batch 1');

In the example shown in the screenshots this results in ‘300000000815248BatchName’ so the string
that needs to be included in the “Batch” parameter is
select to_char(batch_id) from pay_batch_headers
where batch_name = ':300000000815248BatchName'

The final step is to modify the “Batch” parameter:

9
Automating Payroll Batch Loader

Figure 1. Modify “Batch” parameter

Add the following attribute values

ATTRIBUTE NAME VALUE

Flow Parameter Batch

Use for Searches No

Display No

Display Format Text

Sequence 1

Usage Input Parameter

Parameter Basis Post SQL Bind

Basis Value select to_char(batch_id) from pay_batch_headers where batch_name =


':300000000815248BatchName'

Save the modified parameter.

Invoking Transfer Batch Flow

The “Transfer Batch Flow” process is invoked using the FlowActionsService using the following
parameters:

TABLE 3. LOAD BATCH FROM FILE SERVICE INVOCATION

SERVICE hcmProcFlowCoreController/FlowActionsService

METHOD submitFlow

PARAMETER NAME DESCRIPTION

flowName Transfer Batch (or the copied version of this)

legislativeDataGroup LDG into which the data will be loaded

flowInstanceName Unique identifier of the flow to be invoked

recurringFlag false

PARAMETER NAME VALUE PAIRS

PARAMETER NAME PARAMETER VALUE

10
Automating Payroll Batch Loader

BatchName The name of the payroll batch to be loaded to Fusion

Conclusion
Payroll Batch Loader can be used to load various data objects in Fusion HCM. Using the
FlowActionsService the Load Batch from File and Transfer Batch flows can be invoked from outside
Fusion allowing the process to be automated.

Sections to be added in later versions of the document


Subsequent versions of this document will include sections on
 Determining batch Status
 Loading data in PBL by passing in the object name and action
 Writing a transformation formula
 Using Value Set Lookup
 Handling Mulitple Errors

11
Automating Payroll Batch Loader Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
June 2014
Author: John Rhodes This document is provided for information purposes only, and the contents hereof are subject to change without notice. This
document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in
Oracle Corporation
law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any
World Headquarters
liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This
500 Oracle Parkway
document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our
Redwood Shores, CA 94065
prior written permission.
U.S.A.

Worldwide Inquiries: Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Phone: +1.650.506.7000
Fax: +1.650.506.7200 Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
oracle.com trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0114

You might also like