Update
The PATCH Update operation supports preventing the roll forward of specific attributes. This is controlled via a flag set on the attribute that you don't want to roll forward during an update. This flag is set in the code during development.
This table shows the required date effective header parameters and the criteria to perform a PATCH Update operation on date effective objects.
Header Attribute | Applicable | Required | Default Value | Criteria |
---|---|---|---|---|
|
Yes |
No |
Context date |
If If You can update multiple physical records by providing the appropriate For MCPD objects: If If |
|
Yes |
No |
EffectiveEndDate of the record in context |
|
|
Yes |
Yes |
NA |
You must provide the value |
|
Yes |
No |
PHYSICAL_ROW_END_DATE |
Optional. If not provided, the value defaults to When |
|
Yes |
No |
NA |
If not provided, the latest MCPD record ( |
|
Yes |
No |
NA |
NA |
Examples
Let's look at some examples of PATCH Update operations performed on the assignments
child resource of workers
to update records for date effective objects.
Let's say that Alice and Mark have assignments with physical records as shown in the table, respectively. Each row represents a physical record with an effective start date and an effective end date. This sample data is used in the following examples to retrieve the appropriate records, based on the context date provided, and update them.
Physical Record | Effective Start Date | Effective End Date | Department |
---|---|---|---|
1 |
2016-01-01 |
4712-12-31 |
D1 |
1 |
2016-01-01 |
2016-12-31 |
D1 |
2 |
2017-01-01 |
2017-12-31 |
D1 |
3 |
2018-01-01 |
2018-12-31 |
D1 |
4 |
2019-01-01 |
4712-12-31 |
D1 |
Example 1
Alice has an assignment with a single physical record. Let's get her assignment details effective as of 2019-02-25 and update the physical record.
- Retrieve the worker record by performing a GET operation on the
workers
resource using this URL format.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the
assignments
child link by providing theRangeMode
in theeffective-Of
header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2019-02-25 is retrieved and a new physical record with effective start date 2019-02-25 is created after the update.
Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
4712-12-31
D1
1
2016-01-01
2019-02-24
D1
2
2019-02-25
4712-12-31
L1
Example 2
Let's get Mark's assignment details without providing a context date and update the physical record.
- Retrieve the worker record by performing a GET operation on the
workers
resource using this URL format.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the
assignments
child link by providing theRangeMode
in theeffective-Of
header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of
sysdate
(2020-03-12) is retrieved and a new physical record is created after the update.Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-12-31
D1
4
2019-01-01
4712-12-31
D1
4
2019-01-01
2020-03-11
D1
5
2020-03-12
4712-12-31
L1
Example 3
Let's get Mark's assignment details effective as of 2019-02-25 and update the physical record.
- Retrieve the worker record by performing a GET operation on the workers resource using this URL format.
GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the
assignments
child link by providing theRangeMode
in the effective-Of header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2019-02-25 is retrieved and a new physical record with effective start date 2019-02-25 is created after the update.
Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-12-31
D1
4
2019-01-01
4712-12-31
D1
4
2019-01-01
2019-02-24
D1
5
2019-02-25
4712-12-31
L1
Example 4
Let's get Mark's assignment details effective as of 2019-02-25 and update the physical record by providing the RangeStartDate
.
- Retrieve the worker record by performing a GET operation on the workers resource using this URL format.
GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the
assignments
child link by providing theRangeMode
in the effective-Of header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE;RangeStartDate=2018-06-01
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2019-02-25 is retrieved and a new physical record with effective start date 2018-06-01 is created after the update.
Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-05-31
D1
4
2018-06-01
2018-12-31
L1
4
2019-01-01
4712-12-31
D1
5
2019-01-01
4712-12-31
L1
Example 5
Let's get Mark's assignment details effective as of 2018-01-01 and update the physical record by providing the RangeStartDate
and RangeEndDate
.
- Retrieve the worker record by performing a GET operation on the workers resource using this URL format.
GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the
assignments
child link by providing theRangeMode
,RangeStartDate
andRangeEndDate
in theeffective-Of
header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE;RangeStartDate=2018-06-01;RangeEndDate=2019-05-31
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2018-01-01 is retrieved and two new physical records with effective start date 2018-06-01 and 2019-01-01 are created after the update.
Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-05-31
D1
4
2018-06-01
2018-12-31
L1
4
2019-01-01
4712-12-31
D1
5
2019-01-01
2019-05-31
L1
6
2019-06-01
4712-12-31
D1
Example 6
Let's get Mark's assignment details effective as of 2019-02-25 and update the physical record by providing the RangeStartDate
and RangeSpan
.
- Retrieve the worker record by performing a GET operation on the workers resource using this URL format.
GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the assignments child link by providing the
RangeMode
,RangeStartDate
andRangeSpan
in theeffective-Of
header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE;RangeStartDate=2018-01-01;RangeSpan=LOGICAL_ROW_END_DATE
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2019-01-01 is retrieved and physical records 3 and 4 within the
RangeStartDate
2018-01-01 and logical row end date 4712-12-31 are updated.Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-12-31
L1
4
2019-01-01
4712-12-31
D1
4
2019-01-01
4712-12-31
L1
Example 7
Let's get Mark's assignment details effective as of 2019-02-25 and update the physical record by providing the RangeStartDate
and RangeSpan
.
- Retrieve the worker record by performing a GET operation on the
workers
resource using this URL format.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
- Obtain the
assignments
child singular link from the response. -
Perform a PATCH operation on the
assignments
child link by providing theRangeMode
,RangeStartDate
, andRangeSpan
in theeffective-Of
header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE;RangeStartDate=2018-06-01;RangeSpan=PHYSICAL_ROW_END_DATE
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2019-02-25 is retrieved and physical record 3 is split into two and the records within the
RangeStartDate
2018-06-01 and physical row end date 4712-12-31 are updated.Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-05-31
D1
4
2018-01-01
2018-12-31
L1
4
2019-01-01
4712-12-31
D1
5
2019-01-01
4712-12-31
L1
Example 8
Let's get Mark's assignment details effective as of 2019-02-25 and update the physical record by providing the RangeStartDate
and RangeSpan
.
- Retrieve the worker record by performing a GET operation on the
workers
resource using this URL format.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-02-25
- Obtain the
assignments
child singular link from the response. -
Perform a PATCH operation on the
assignments
child link by providing theRangeMode
,RangeStartDate
, andRangeSpan
in theeffective-Of
header attribute and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE;RangeStartDate=2018-06-01;RangeSpan=LOGICAL_ROW_END_DATE
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record as of 2019-02-25 is retrieved and physical record 3 is split into two. Physical records 3 and 4 within the
RangeStartDate
2018-01-01 and logical row end date 4712-12-31 are updated.Before Update After Update Physical Record Effective Start Date Effective End Date Department Physical Record Effective Start Date Effective End Date Department 1
2016-01-01
2016-12-31
D1
1
2016-01-01
2016-12-31
D1
2
2017-01-01
2017-12-31
D1
2
2017-01-01
2017-12-31
D1
3
2018-01-01
2018-12-31
D1
3
2018-01-01
2018-05-31
D1
4
2018-01-01
2018-12-31
L1
4
2019-01-01
4712-12-31
D1
5
2019-01-01
4712-12-31
L1
Multiple Changes Per Day
Let's look at some examples of PATCH update operations performed on the assignments
child resource of workers
to update records for multiple changes on the same day.
Let's say that Mark has an assignment with four physical records, as shown in the table. Each row represents a physical record with an effective start date and an effective end date. This sample data is used in the following examples to retrieve the appropriate records, based on the context date provided, and update them.
Physical Record | Effective Start Date | Effective End Date | Department | Range Sequence | Effective Latest Change |
---|---|---|---|---|---|
1 |
2016-01-01 |
2016-12-31 |
D1 |
1 |
Y |
2 |
2017-01-01 |
2017-12-31 |
D1 |
1 |
Y |
3 |
2018-01-01 |
2018-12-31 |
D1 |
1 |
Y |
4 |
2019-01-01 |
4712-12-31 |
D1 |
1 |
Y |
Example 1
Let's get Mark's assignment details effective as of 2019-01-01 and update the physical record by providing the RangeStartDate
and RangeEndDate
.
- Retrieve the worker record by performing a GET operation on the
workers
resource, providing theeffectiveDate
parameter in the URL.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2019-01-01
- Obtain the
assignments
child singular link from the response. - Perform a PATCH operation on the
assignments
child link by providing theRangeMode
,RangeStartDate
andRangeEndDate
in theeffective-Of header
attribute, and the updated details in the request body.PATCH /hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}/ child/assignments/{assignmentsUniqID}
Header
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeMode=UPDATE;RangeStartDate=2018-01-01;RangeEndDate=4712-12-31
Sample Request
{ "DepartmentName": "L1" }
- Verify the details returned in the response. The assignment record effective as of 2019-01-01 with
RangeStartDate
2018-01-01 andRangeEndDate
4712-12-31 is retrieved and updated.Physical record 3 is split into two records with Range Sequence 1 and 2. The record with sequence 1 is a same day record without the effective latest change. The record with sequence 2 is the updated record with effective latest change applied. Physical record 4 is also updated with the change.
Before Update After Update Physical Record Effective Start Date Effective End Date Department Range Sequence Effective Latest Change Physical Record Effective Start Date Effective End Date Department Range Sequence Effective Latest Change 1
2016-01-01
2016-12-31
D1
1
Y
1
2016-01-01
2016-12-31
D1
1
Y
2
2017-01-01
2017-12-31
D1
1
Y
2
2017-01-01
2017-12-31
D1
1
Y
3
2018-01-01
2018-12-31
D1
1
Y
3
2018-01-01
2018-01-01
D1
1
N
3
2018-01-01
2018-12-31
L1
2
Y
4
2019-01-01
4712-12-31
D1
1
Y
4
2019-01-01
4712-12-31
L1
1
Y