This article is part of the “HCM Extracts: Issues and Solutions” series that covers issues and unexpected behaviour when designing and invoking HCM Extracts.
Synopsis
When you schedule an HCM Extract you typically want to set the Effective Date to either the same day as when the Extract instance runs, or as an offset from this day.
However, once the HCM Extract runs are initiated you find that the Effective Date being passed to the HCM Extract remains the same for all runs and is not set according to the day the Extract runs.
Symptoms
An HCM Extract is invoked using a schedule.
All subsequent invocations of the HCM Extract that are generated by the schedule have the same Effective Date as the original instance.
Detailed Explanation
When an HCM Extract is built, by default one of the parameters that is generated is Effective Date.
The corresponding Payroll Flow has an Effective Date Flow Parameter as well as an Effective Date Flow Task Parameter.
The Flow Task Parameter has the following properties:
- Parameter Basis = Bind to Flow
- Basis Value = Effective Date
These settings mean that the Flow Task Parameter inherits its value from the Flow Parameter value.
Figure 1: Effective Date Flow Task Parameter default settings
When an HCM Extract is invoked using a schedule the initial Effective Date is entered by the user.
Upon submission there are 2 extract instances created:
The 1st extract instance is started and is processed straight away.
Another extract instance is created in a Wait state, ready to be invoked according to the schedule. This instance takes the same parameter values as given when the schedule was first invoked.
When the 2nd instance starts processing, it also generates another scheduled instance, with the same parameters, and this cycle continues unless a schedule end date is reached.
Figure 2: Scheduled Processes initiated
Figure 3: Effective Date parameter has the same value as the original run
Because the Flow Task Parameter inherits the Flow Parameter value, and because the scheduled instances all have the original Effective Date value, every invocation of the HCM Extract will have this Effective Date.
Solution
When the HCM Extract instance starts the Flow Task Parameter values are evaluated.
By changing the method of deriving the Effective Date Flow Task Parameter it is possible to generate a new Effective Date value on each invocation of an HCM Extract instance.
The Parameter Basis and basis Value for the Effective Date Flow Task Parameter must be changed, and the specific values depend on whether the Effective Date is to be set to SYSDATE or another date.
If SYSDATE is required, the following parameters should be set:
- Parameter Basis = Context Bind
- Basis Value = System Date
Figure 4: Parameter settings when SYSDATE is required
If an offset from SYSDATE is required, the following parameters should be set:
- Parameter Basis = Post SQL
- Basis Value = select to_char(sysdate-1, ‘YYYY-MM-DD’) from dual
N.B. The select statement must all be entered on 1 line without any line breaks.
Figure 5:Parameter Setting when offset from SYSDATE is required
When the Payroll Flow is invoked, the Effective Date parameter is entered by the user and that value is shown in the Flow Instance Criteria information. Note that the value shown in the Criteria section will always be the original Effective Date used.
Figure 6:Scheduled Instance has original EffectiveDate in Criteria
However, the generated XML shows that Date that was actually used in the HCM Extract run took the value as defined by the Payroll Flow Task Parameter.
Summary
This blog shows how to control the parameters that are passed to an HCM Extract when it is scheduled by changing the settings in the Payroll Flow Task Parameter UI.
It is part of the “HCM Extracts: Issues and Solutions” series that covers issues and unexpected behaviour when designing and invoking HCM Extracts.