Example: Identifying and resolving out-of-sequence conflicts
It is possible to create multiple out-of-sequence conflicts on a job. This example shows how to resolve three conflicts on the same job.
Consider the following sequence:
- In the initial job, an account was created for Bill Preston, his date of birth was set to
January 1, 1970, and his address was set to
null. Additionally, the number of employees at his company was set at 0. - In the first change to the job, Bill's date of birth was revised to January 1, 1975, and he was given an address, the first line of which is 24 Appletree Rd.
- In the second change, Bill's date of birth was revised to January 1, 1977, and the number of employees at his company was raised to 2.
- In the third change, Bill's date of birth was revised yet again, to January 1, 1980, and the
first line of his address was changed to 88 Maple Lane. Also, the number of employees
at his company was changed to
null.
The above information, in table form:
| Sequence | Date of birth | Address | Employee count |
|---|---|---|---|
| 1 | 1970-01-01 | null | 0 |
| 2 | 1975-01-01 | 24 Appletree Rd. | |
| 3 | 1977-01-01 | 2 | |
| 4 | 1980-01-01 | 88 Maple Lane | null |
After these changes have been submitted, a call to
/job/v1/jobs/{jobId}/oss-conflicts returns the following response:
{
"data": {
"attributes": {
"conflicts": [
{
"conflictValues": [
{
"displayValue": "01/01/1975",
"effectiveDate": "2019-03-01T00:01:00.000Z"
},
{
"displayValue": "01/01/1977",
"effectiveDate": "2019-04-01T00:01:00.000Z"
}
],
"entity": {
"displayName": "Bill Preston",
"id": "pc:703",
"type": "PolicyContact",
"uri": "/job/v1/jobs/pc:204/contacts/pc:703"
},
"field": "dateOfBirthInternal",
"id": "b0aca4b",
"originalValue": "01/01/1970",
"yourValue": "01/01/1980"
},
{
"conflictValues": [
{
"displayValue": "Address Line 1; Future Change",
"effectiveDate": "2019-03-01T00:01:00.000Z"
},
{
"displayValue": "Address Line 1; Future Change",
"effectiveDate": "2019-04-01T00:01:00.000Z"
}
],
"entity": {
"displayName": "1: Address Line 1; OOS Change, CA",
"id": "201",
"type": "PolicyLocation",
"uri": "/job/v1/jobs/pc:204/locations/201"
},
"field": "addressLine1Internal",
"id": "df78662",
"originalValue": "",
"yourValue": "Address Line 1; OOS Change"
},
{
"conflictValues": [
{
"displayValue": "2",
"effectiveDate": "2019-04-01T00:01:00.000Z"
}
],
"entity": {
"displayName": "1: Address Line 1; OOS Change, CA",
"id": "201",
"type": "PolicyLocation",
"uri": "/job/v1/jobs/pc:204/locations/201"
},
"field": "employeeCountInternal",
"id": "47761d4",
"originalValue": "0",
"yourValue": ""
}
]
},
. . .
}
The same response can be constrained using field selection, by appending
?fields=conflicts.id,conflicts.field,conflicts.originalValue,conflicts.yourValue
to the request URL:
{
"data": {
"attributes": {
"conflicts": [
{
"field": "dateOfBirthInternal",
"id": "b0aca4b",
"originalValue": "01/01/1970",
"yourValue": "01/01/1980"
},
{
"field": "addressLine1Internal",
"id": "df78662",
"originalValue": "",
"yourValue": "88 Maple Lane"
},
{
"field": "employeeCountInternal",
"id": "47761d4",
"originalValue": "0",
"yourValue": ""
}
]
}
}
}
Note that in the response object the JSON null type is represented by
an empty string.
To resolve these conflicts, choices must be made between the original values and the most
recent values, and this information must be passed in the request body to POST
/job/v1/jobs/{jobId}/oss-conflicts/resolve:
{
"data": {
"attributes": {
"overrides": [
{
"id": "b0aca4b",
"resolution": "acceptYours"
},
{
"id": "df78662",
"resolution": "acceptYours"
},
{
"id": "47761d4",
"resolution": "discardYours"
}
]
}
}
}
Following this post, Bill's birthdate will be January 1, 1980, his address will be 88 Maple Lane, and the number of employees at his company will be set to "0".