简介

利用 HCM 云,您可以使用具有只读数据存储的新一代平台从 HCM 提取数据。

目标

完成本教程后,您将了解如何:

  • 查询 Worker 提取视图及其对象层次结构
  • 异步提交和跟踪提取作业请求,以检索选定的员工层次结构数据
  • 下载提取输出文件

先决条件

开始之前:

  1. 请与 Oracle CoE 联系,以确保在云池中预配了只读数据存储并且正在复制您的数据
  2. 执行必需的安全配置,包括:
    • 数据安全设置
    • OAuth 客户端应用程序设置

用例

此功能允许您解决以下用例。

完整数据提取

完全提取员工数据可以是一次性活动或定期活动。

您可以检索整个对象层次结构,也可以只检索其中的一部分。

完全数据提取将检索与筛选标准匹配的所有记录,并且输出文件可能非常大。

将从请求的有效日期检索有效对象,其中当前提取日期为默认值。

增量数据提取

Worker 数据的增量提取通常是定期计划的活动。

您可以检索整个对象层次结构,也可以只检索其中的一部分。

在此用例中,您希望仅检索自上一次提取运行以来发生更改的对象,其中第一次提取运行是基线。要实现此目的,必须在需要进行更改检测的任何级别应用 timeUpdated 属性筛选器。

增量数据提取查询可以应用其他筛选标准。与完全提取相比,输出文件通常较小,因为它们仅包含增量。

将仅检索属性的当前值。

将从请求的有效日期检索有效对象,其中当前提取日期为默认值。

注意:

物理删除的记录不会使用 timeUpdated 筛选返回。

任务 1:选择提取视图

根据所需的对象和属性选择要使用的提取视图。下面列出了截至发行版 26A 的可用视图以及可提取的对象和属性,这些对象和属性按模块分组。

对于日期有效对象,您通常会找到一个常规视图,该视图返回自给定日期起生效的数据,另外还会找到一个历史记录视图,该视图返回所有日期有效记录。

多语种:

此时,可转换属性只能使用英语。

全球 HR - 雇用

模块名 oraHcmHrCoreEmployment
模块上下文路径 hcmHrCore/employment

视图名称 属性
actionExtracts id
actionCode
startDate
endDate
timeCreated
timeUpdated
createdBy
updatedBy
actionName
说明
assignmentStatusTypeExtracts id
assignmentStatusCode
fromDate
toDate
activeFlag
defaultFlag
timeCreated
timeUpdated
createdBy
updatedBy
userStatus
emailExtracts 标识
fromDate
toDate
emailAddress
timeUpdated
updatedBy
timeCreated
createdBy
primaryFlag
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
type.lookupCode
type.lookupType
type.meaning
legislativeInformationExtracts 标识
effectiveStartDate
effectiveEndDate
性别
maritalStatus
maritalStatusChangeDate
highestEducationLevel
timeUpdated
updatedBy
timeCreated
createdBy
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
legislation.territoryCode
legislation.territoryShortName
legislativeInformationHistoryExtracts 标识
effectiveStartDate
effectiveEndDate
性别
maritalStatus
maritalStatusChangeDate
highestEducationLevel
timeUpdated
updatedBy
timeCreated
createdBy
personDetail.id
personDetail.personNumber
legislation.territoryCode
legislation.territoryShortName
managerHierarchyExtracts effectiveStartDate
effectiveEndDate
personId
assignmentId
managerType
managerLevel
managerId
managerAssignmentId
primaryAssignmentFlag
primaryManagerFlag
createdBy
timeCreated
updatedBy
timeUpdated
personAssignment.id
personAssignment.effectiveStartDate
personAssignment.effectiveEndDate
personAssignment.effectiveSequence
personAssignment.effectiveLatestChange
personAssignment.assignmentType
personAssignment.assignmentNumber
personAssignment.primaryFlag
personAssignment.businessTitle
personAssignment.workAtHomeFlag
personAssignment.officeBuilding
personAssignment.officeFloor
personAssignment.officeMailStop
personAssignment.officeNumber
personAssignment.primaryAssignmentFlag
personAssignment.primaryWorkRelationshipFlag
personAssignment.timeUpdated
personAssignment.updatedBy
personAssignment.timeCreated
personAssignment.createdBy
personAssignment.systemPersonType
personAssignment.labourUnionMemberFlag
personAssignment.managerFlag
personAssignment.probationEndDate
personAssignment.probationPeriod
personAssignment.probationPeriodUnit
personAssignment.normalHours
personAssignment.frequency
personAssignment.endTime
personAssignment.startTime
personAssignment.noticePeriod
personAssignment.noticePeriodUOM
personAssignment.workerCategory
personAssignment.assignmentCategory
personAssignment.hourlyPaidOrSalaried
personAssignment.projectedEndDate
personAssignment.projectedStartDate
personAssignment.assignmentStatusType
personAssignment.retirementAge
personAssignment.retirementDate
personAssignment.synchronizeFromPositionFlag
personAssignment.fullTimeOrPartTime
personAssignment.permanentAssignmentFlag
personAssignment.seniorityBasis
personAssignment.overtimePeriod
personAssignment.adjustedFullTimeEquivalent
personAssignment.annualWorkingDuration
personAssignment.annualWorkingDurationUnit
personAssignment.annualWorkingRatio
personAssignment.standardFrequency
personAssignment.standardWorkingHours
personAssignment.standardAnnualWorkingDuration
personAssignment.sequence
personAssignment.department.id
personAssignment.department.name
personAssignment.department.title
personAssignment.department.effectiveStartDate
personAssignment.department.effectiveEndDate
personAssignment.legalEmployer.id
personAssignment.legalEmployer.name
personAssignment.legalEmployer.effectiveStartDate
personAssignment.legalEmployer.effectiveEndDate
personAssignment.legislation.territoryCode
personAssignment.legislation.territoryShortName
personAssignment.position.id
personAssignment.position.effectiveStartDate
personAssignment.position.effectiveEndDate
personAssignment.position.name
personAssignment.position.code
personAssignment.grade.id
personAssignment.grade.effectiveStartDate
personAssignment.grade.effectiveEndDate
personAssignment.grade.name
personAssignment.grade.code
personAssignment.location.id
personAssignment.location.effectiveStartDate
personAssignment.location.effectiveEndDate
personAssignment.location.name
personAssignment.location.code
personAssignment.location.mainAddress.id
personAssignment.location.mainAddress.effectiveStartDate
personAssignment.location.mainAddress.effectiveEndDate
personAssignment.location.mainAddress.county
personAssignment.location.mainAddress.state
personAssignment.location.mainAddress.province
personAssignment.location.mainAddress.townOrCity
personAssignment.location.mainAddress.postalCode
personAssignment.location.mainAddress.longPostalCode
personAssignment.location.mainAddress.addressLine1
personAssignment.location.mainAddress.addressLine2
personAssignment.location.mainAddress.addressLine3
personAssignment.location.mainAddress.addressLine4
personAssignment.location.mainAddress.country.territoryCode
personAssignment.location.mainAddress.country.territoryShortName
personAssignment.job.id
personAssignment.job.effectiveStartDate
personAssignment.job.effectiveEndDate
personAssignment.job.name
personAssignment.job.code
personAssignment.job.jobFunctionCode
personAssignment.job.managerLevel
personAssignment.job.jobFamily.id
personAssignment.job.jobFamily.effectiveStartDate
personAssignment.job.jobFamily.effectiveEndDate
personAssignment.job.jobFamily.code
personAssignment.job.jobFamily.name
personAssignment.collectiveAgreement.id
personAssignment.collectiveAgreement.effectiveStartDate
personAssignment.collectiveAgreement.effectiveEndDate
personAssignment.collectiveAgreement.name
personAssignment.personType.id
personAssignment.personType.userPersonType
personAssignment.workerUnion.id
personAssignment.workerUnion.effectiveStartDate
personAssignment.workerUnion.effectiveEndDate
personAssignment.workerUnion.name
personAssignment.assignmentUserStatus.id
personAssignment.assignmentUserStatus.userStatus
personAssignment.businessUnit.id
personAssignment.businessUnit.effectiveStartDate
personAssignment.businessUnit.effectiveEndDate
personAssignment.businessUnit.name
personAssignment.account.codeCombinationId
personAssignment.account.concatenatedSegments
personAssignment.account.chartOfAccountsId
personAssignment.ledger.ledgerId
personAssignment.ledger.name
personAssignment.workRelationship.id
personAssignment.workRelationship.startDate
personAssignment.workRelationship.workerType
personAssignment.workRelationship.timeCreated
personAssignment.workRelationship.timeUpdated
personAssignment.localName.id
personAssignment.localName.effectiveStartDate
personAssignment.localName.effectiveEndDate
personAssignment.localName.lastName
personAssignment.localName.firstName
personAssignment.localName.displayName
personAssignment.localName.listName
personAssignment.localName.timeCreated
personAssignment.localName.timeUpdated
personAssignment.globalName.id
personAssignment.globalName.effectiveStartDate
personAssignment.globalName.effectiveEndDate
personAssignment.globalName.lastName
personAssignment.globalName.firstName
personAssignment.globalName.displayName
personAssignment.globalName.listName
personAssignment.globalName.timeCreated
personAssignment.globalName.timeUpdated
personAssignment.personDetail.id
personAssignment.personDetail.personNumber
personAssignment.personDetail.effectiveStartDate
personAssignment.personDetail.effectiveEndDate
personAssignment.personDetail.timeCreated
personAssignment.personDetail.timeUpdated
nameExtracts id
effectiveStartDate
effectiveEndDate
lastname
firstname
middlenames
title
prefix
suffix
knownAs
previousLastname
honors
militaryRank
displayname
fullname
listname
ordername
type
timeUpdated
updatedBy
timeCreated
createdBy
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
legislation.territoryCode
legislation.territoryShortname
nationalIdentifierExtracts 标识
createdBy
expirationDate
issueDate
identifierNumber
placeOfIssue
timeCreated
timeUpdated
updatedBy
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
country.territoryCode
country.territoryShortName
type.lookupCode
type.lookupType
type.meaning
personAddressExtracts id
effectiveStartDate
effectiveEndDate
type
primaryFlag
timeCreated
timeUpdated
createdBy
updatedBy
building
floorNumber
townOrCity
postalCode
longPostalCode
addressLine1
addressLine2
addressLine3
addressLine4
county
state
province
country.territoryCode
country.territoryShortName
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
personAddressHistoryExtracts 标识
effectiveStartDate
effectiveEndDate
类型
primaryFlag
timeCreated
timeUpdated
createdBy
updatedBy
建筑
floorNumber
townOrCity
postalCode
longPostalCode
addressLine1
addressLine2
addressLine3
addressLine4
计数
状态
省份
country.territoryCode
country.territoryShortName
personTypeExtracts 标识
systemPersonType
activeFlag
defaultFlag
timeCreated
timeUpdated
createdBy
updatedBy
userPersonType
phoneExtracts 标识
fromDate
toDate
phoneNumber
areaCode
countryCodeNumber
扩展
有效性
timeUpdated
updatedBy
timeCreated
createdBy
primaryFlag
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
legislation.territoryCode
legislation.territoryShortName
type.lookupCode
type.lookupType
type.meaning
workerAssignmentExtracts id
effectiveStartDate
effectiveEndDate
effectiveSequence
effectiveLatestChange
assignmentType
assignmentNumber
primaryFlag
businessTitle
workAtHomeFlag
officeBuilding
officeFloor
officeMailStop
officeNumber
primaryAssignmentFlag
primaryWorkRelationshipFlag
timeUpdated
updatedBy
timeCreated
createdBy
systemPersonType
labourUnionMemberFlag
managerFlag
probationEndDate
probationPeriod
probationPeriodUnit
normalHours
frequency
endTime
startTime
noticePeriod
noticePeriodUOM
workerCategory
assignmentCategory
hourlyPaidOrSalaried
projectedEndDate
projectedStartDate
assignmentStatusType
expenseCheckSendToAddress
retirementAge
retirementDate
synchronizeFromPositionFlag
fullTimeOrPartTime
permanentAssignmentFlag
seniorityBasis
overtimePeriod
adjustedFullTimeEquivalent
annualWorkingDuration
annualWorkingDurationUnit
annualWorkingRatio
standardFrequency
standardWorkingHours
standardAnnualWorkingDuration
sequence
department.id
department.name
department.title
department.effectiveStartDate
department.effectiveEndDate
legalEmployer.id
legalEmployer.name
legalEmployer.effectiveStartDate
legalEmployer.effectiveEndDate
legislation.territoryCode
legislation.territoryShortName
position.id
position.ffectiveStartDate
position.effectiveEndDate
position.name
position.code
grade.id
grade.effectiveStartDate
grade.effectiveEndDate
grade.name
grade.code
location.id
location.effectiveStartDate
location.effectiveEndDate
location.name
location.code
location.mainAddress.id
location.mainAddress.effectiveStartDate
location.mainAddress.effectiveEndDate
location.mainAddress.county
location.mainAddress.state
location.mainAddress.province
location.mainAddress.townOrCity
location.mainAddress.postalCode
location.mainAddress.longPostalCode
location.mainAddress.addressLine1
location.mainAddress.addressLine2
location.mainAddress.addressLine3
location.mainAddress.addressLine4
location.mainAddress.country.territoryCode
location.mainAddress.country.territoryShortName
job.id
job.effectiveStartDate
job.effectiveEndDate
job.name
job.code
job.jobFunctionCode
job.managerLevel
job.jobFamily.id
job.jobFamily.effectiveStartDate
job.jobFamily.effectiveEndDate
job.jobFamily.code
job.jobFamily.name
collectiveAgreement.id
collectiveAgreement.effectiveStartDate
collectiveAgreement.effectiveEndDate
collectiveAgreement.name
personType.id
personType.userPersonType
workerUnion.id
workerUnion.effectiveStartDate
workerUnion.effectiveEndDate
workerUnion.name
assignmentUserStatus.id
assignmentUserStatus.userStatus
businessUnit.id
businessUnit.effectiveStartDate
businessUnit.effectiveEndDate
businessUnit.name
account.codeCombinationId
account.concatenatedSegments
account.chartOfAccountsId
ledger.ledgerId
ledger.name
workRelationship.id
workRelationship.startDate
workRelationship.workerType
workRelationship.timeCreated
workRelationship.timeUpdated
localName.id
localName.effectiveStartDate
localName.effectiveEndDate
localName.lastName
localName.firstName
localName.displayName
localName.listName
localName.timeCreated
localName.timeUpdated
globalName.id
globalName.effectiveStartDate
globalName.effectiveEndDate
globalName.lastName
globalName.firstName
globalName.displayName
globalName.listName
globalName.timeCreated
globalName.timeUpdated
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate
personDetail.timeCreated
personDetail.timeUpdated
workerAssignmentHistoryExtracts id
effectiveStartDate
effectiveEndDate
effectiveSequence
effectiveLatestChange
assignmentType
assignmentNumber
primaryFlag
businessTitle
workAtHomeFlag
officeBuilding
officeFloor
officeMailStop
officeNumber
primaryAssignmentFlag
primaryWorkRelationshipFlag
timeUpdated
updatedBy
timeCreated
createdBy
systemPersonType
labourUnionMemberFlag
managerFlag
probationEndDate
probationPeriod
probationPeriodUnit
normalHours
frequency
endTime
startTime
noticePeriod
noticePeriodUOM
workerCategory
assignmentCategory
hourlyPaidOrSalaried
projectedEndDate
projectedStartDate
assignmentStatusType
expenseCheckSendToAddress
retirementAge
retirementDate
synchronizeFromPositionFlag
fullTimeOrPartTime
permanentAssignmentFlag
seniorityBasis
overtimePeriod
adjustedFullTimeEquivalent
annualWorkingDuration
annualWorkingDurationUnit
annualWorkingRatio
standardFrequency
standardWorkingHours
standardAnnualWorkingDuration
sequence
department.id
legalEmployer.id
legislation.territoryCode
legislation.territoryShortName
position.id
grade.id
location.id
location.mainAddress.id
location.mainAddress.country.territoryCode
location.mainAddress.country.territoryShortName
job.id
job.jobFamily.id
collectiveAgreement.id
personType.id
personType.userPersonType
workerUnion.id
assignmentUserStatus.id
assignmentUserStatus.userStatus
businessUnit.id
account.codeCombinationId
account.concatenatedSegments
account.chartOfAccountsId
ledger.ledgerId
ledger.name
workRelationship.id
localName.id
globalName.id
personDetail.id
personDetail.personNumber
workRelationshipExtracts id
startDate
workerType
timeCreated
timeUpdated
workerNumber
primaryFlag
createdBy
updatedBy
readyToConvertFlag
enterpriseSeniorityDate
legalEmployerSeniorityDate
onMilitaryServiceFlag
lastWorkingDate
terminationDate
notificationDate
projectedTerminationDate
legalEmployer.id
legalEmployer.name
legalEmployer.effectiveStartDate
legalEmployer.effectiveEndDate
legislation.territoryCode
legislation.territoryShortName
personDetail.id
personDetail.personNumber
personDetail.effectiveStartDate
personDetail.effectiveEndDate

全球人力资源 - 工作结构

模块名 oraHcmHrCoreWorkStructures
模块上下文路径 hcmHrCore/workStructures

视图名称 属性
gradeExtracts id
createdBy
effectiveStartDate
effectiveEndDate
代码
timeCreated
timeUpdated
updatedBy
状态
名称
gradeHistoryExtracts id
createdBy
effectiveStartDate
effectiveEndDate
代码
timeCreated
timeUpdated
updatedBy
状态
名称
jobExtracts id
名称
effectiveStartDate
effectiveEndDate
代码
状态
createdBy
timeCreated
updatedBy
timeUpdated
jobFamilyExtracts id
代码
名称
effectiveStartDate
effectiveEndDate
状态
timeUpdated
updatedBy
timeCreated
createdBy
jobFamilyHistoryExtracts id
代码
名称
effectiveStartDate
effectiveEndDate
状态
timeUpdated
updatedBy
timeCreated
createdBy
jobHistoryExtracts id
名称
effectiveStartDate
effectiveEndDate
代码
状态
createdBy
timeCreated
updatedBy
timeUpdated
locationExtracts 标识
createdBy
effectiveStartDate
effectiveEndDate
代码
timeCreated
timeUpdated
updatedBy
状态
countryCode
employeeLocationFlag
shipToSiteFlag
receivingSiteFlag
billToSiteFlag
officeSiteFlag
detailCreatedBy
detailTimeCreated
detailUpdatedBy
detailTimeUpdated
timezoneCode
说明
名称
locationHistoryExtracts 标识
createdBy
effectiveStartDate
effectiveEndDate
代码
timeCreated
timeUpdated
updatedBy
状态
countryCode
employeeLocationFlag
shipToSiteFlag
receivingSiteFlag
billToSiteFlag
officeSiteFlag
detailCreatedBy
detailTimeCreated
detailUpdatedBy
detailTimeUpdated
timezoneCode
说明
名称
positionExtracts id
effectiveStartDate
effectiveEndDate
代码
状态
hiringStatus
createdBy
timeCreated
updatedBy
timeUpdated
名称
positionHistoryExtracts id
effectiveStartDate
effectiveEndDate
代码
状态
hiringStatus
createdBy
timeCreated
updatedBy
timeUpdated
名称

HCM 公用 - 事件

模块名 oraHcmHrCoreEvents
模块上下文路径 hcmHrCore/events
视图名称 属性
objectChangeExtracts id
sourceObjectName
groupSequence
operationType
dateEffectiveMode
effectiveDate
keyAttribute1Name
keyAttribute1DataType
keyAttribute1StringValue
keyAttribute1NumberValue
keyAttribute1DateValue
keyAttribute2Name
keyAttribute2DataType
keyAttribute2StringValue
keyAttribute2NumberValue
keyAttribute2DateValue
keyAttribute3Name
keyAttribute3DataType
keyAttribute3StringValue
keyAttribute3NumberValue
keyAttribute3DateValue
purgeDate
createdBy
timeCreated
updatedBy
timeUpdated
changeComponents.id
changeComponents.physicalType
changeComponents.logicalType
changeComponents.oldEffectiveStartDate
changeComponents.newEffectiveStartDate
changeComponents.oldEffectiveEndDate
changeComponents.newEffectiveEndDate
changeComponents.oldEffectiveSequence
changeComponents.newEffectiveSequence
changeComponents.createdBy
changeComponents.timeCreated
changeComponents.updatedBy
changeComponents.timeUpdated
changeComponents.changedAttributes.changedAttributesXml

任务 2:准备和测试提取查询

每个提取视图都有一个查询 API,可用于构建和测试提取查询。

URL /api/boss/data/objects/ora/{{moduleContextPath}}/v1/{{viewName}}/$query
HTTP 方法 POST
请求模板
{
    "collection": {
        "limit": {{limit}},
        "offset": {{offset}},
        "sortBy": [ {{sortAttributes}} ],
        "filter": "{{topLevelFilter}}"
    },
    "fields": [ {{topLevelAttributes}} ],
    "accessors": {
        "{{childObject}}": {
            "collection": {
                "filter": "{{childLevelFilter}}"
            },
            "fields": [ {{childLevelAttributes}} ],
            "accessors": {
                {{nestedChildAccessors}}               
            }
        },
        ...
    }
}
响应模板
200 OK

{
	"items": [
		{{items}}
	],
	"hasMore": {{hasMore}}
}

对象和属性

定义要提取的数据,即应包括哪些对象和属性。包含子对象需要添加存取程序,而包含特定字段需要在 fields 数组中列出它们。请参见完整示例

过滤

定义如何筛选数据。您可以使用以下表达式为查询构建筛选器。

用途 表达式 范例
平等测试 field = value ename = 'KING'
不平等测试 field != value activeFlag != true
大于测试
小于测试
field > value
field < value
sal > 1999.99
hireDate < '2000-01-01'
timeUpdated> '1900-01-01T13:51:54Z'
大于或等于测试
小于或等于测试
field >= value
field <= value< code>
sal >= 1999.99
hireDate <= '2000-01-01'
timeUpdated >= '1900-01-01T13:51:54Z'
模式配对 field LIKE 'pattern' job LIKE 'SALES%'
成员资格测试 field IN (value1, ..., valueN) deptno IN (10, 20, 40)
不区分大小写 field ~= value
field ~!= value
field ~> value
field ~< value
field ~>= value
field ~<= value
field ~LIKE 'pattern'
field ~IN (value1, ..., valueN)
ename ~= 'king'
存在性测试(对于一对多关系) child[expression] assignments[startDate = null]
逻辑与 expression AND expression  
逻辑或 expression OR expression  
逻辑非 !(expression)  

在一对一关系中按子对象进行筛选:

对于一对一关系,您可以在筛选器子句中引用子对象及其属性,就像引用其他父对象的属性一样,例如 legalEmployer.id in (1001, 1002)

在一对多关系中筛选子对象:

在极少数情况下,由复数存取程序名称指示的一对多关系中,上表中的存在测试将筛选至少有一个满足标准的子项的父项。但是,这并不意味着子记录(如果检索)将被自动筛选。如果要确保只获取符合标准的子记录,也必须在子级别重复该筛选器。

例如,如果要仅检索物理类型为 UPDATE 的更改组件,则需要在对象更改查询中应用以下筛选器:


{
    "collection": {
        "filter": "changeComponents[physicalType = 'UPDATE']"
    },
    "accessors": {
        "changeComponents": {
            "collection": {
                "filter": "physicalType = 'UPDATE'"
            },
...
                

按生效日期筛选:

对于日期有效的对象,默认情况下,您将获得自当前日期起生效的数据。要检索自特定日期起生效的数据,请使用 $effectiveDate HTTP 查询参数。

例如,如果要检索自 2023-01-01 起生效的数据,请使用以下 URL 进行查询:

/api/boss/data/objects/ora/hcmHrCore/employment/v1/{{viewPath}}/$query?$effectiveDate=2023-01-01

排序

定义如何对数据进行排序。排序由排序属性数组表示,包括排序方向(升序或降序)。例如:

"sortBy": [
    {
        "totalAmount": "desc"
    },
    {
        "paidAmount": "asc"
    }
]

页活动

定义如何分页数据。客户机可以通过提供限制和偏移参数来控制分页。例如:

"limit": 200,
"offset": 400

默认限制为 25,最大限制为 1000

默认偏移量为 0,表示结果的开头。

响应中的顶层 hasMore 属性指示是否需要提取更多结果。

分页不应用作提取数据的替代方法。查询此 API 时,无法保证数据不会在请求之间发生更改。使用异步 API 提取数据。

范例

下面的示例提取查询旨在检索分配信息以及合法雇主和部门详细信息,这些信息包括:

  • 是主要分配
  • 是“员工”类型
  • 不属于 ID 为 1000110002 的合法雇主
  • 截至提取日期有效
  • 自上次运行以来已更新(或已创建)

请求示例

请注意 limit 参数和 timeUpdated 属性条件以及上次提取运行的时间戳。

POST /api/boss/data/objects/ora/hcmHrCore/employment/v1/workerAssignmentExtracts/$query
 
{
    "collection": {
        "limit": 10,
        "filter": "primaryFlag = true and timeUpdated > '2025-05-01T00:00:00Z' and assignmentType = 'E' and !(legalEmployer.id in (10001, 10002))"
    },
    "fields": [ "id", "assignmentType", "assignmentStatusType", "effectiveStartDate", "effectiveEndDate", "businessTitle", "workAtHomeFlag", "assignmentNumber", "timeUpdated" ],
    "accessors": {
        "personDetail": {
            "fields": [ "personNumber" ]
        },
        "globalName": {
            "fields": [ "firstName", "lastName" ]
        },
        "department": {
            "fields": [ "id", "name", "title" ]
        },
        "legalEmployer": {
            "fields": [ "id", "name" ]
        },
        "workRelationship": {
            "fields": [ "id" ]
        }
    }
}
				

响应示例

200 OK
 
{
    "items": [
        {
            "id": "300000795682243",
            "assignmentType": "E",
            "assignmentStatusType": "ACTIVE",
            "effectiveStartDate": "2018-06-14",
            "effectiveEndDate": "4712-12-31",
            "businessTitle": "Aeronautical Engineer Level-9352",
            "workAtHomeFlag": false,
            "assignmentNumber": "EHDLWorker_190903_1637",
            "timeUpdated": "2025-05-06T11:42:17.821Z",
            "$id": "300000795682243",
            "$context": {
                "etag": "89"
            },
            "personDetail": {
                "personNumber": "HDLWorker_190903_1637",
                "$id": "100000329366771",
                "$context": {
                    "etag": ""
                }
            },
            "globalName": {
                "firstName": "Raymond-Olivier",
                "lastName": "Beer-Tröst",
                "$id": "300000795668871",
                "$context": {
                    "etag": ""
                }
            },
            "department": {
                "id": "300000044556980",
                "name": "South - Venaria DC-GROUP/SFIELESOIT74155",
                "title": null,
                "$id": "300000044556980",
                "$context": {
                    "etag": "13",
                    "links": {
                        "$self": {
                            "href": "https://example.com/api/boss/data/objects/ora/hcmHrCore/workStructures/v1/departments/300000044556980?$effectiveDate=2025-05-13"
                        }
                    }
                }
            },
            "legalEmployer": {
                "id": "300000046740247",
                "name": "PSR_US_LE_1",
                "$id": "300000046740247",
                "$context": {
                    "etag": "15",
                    "links": {
                        "$self": {
                            "href": "https://example.com/api/boss/data/objects/ora/hcmHrCore/workStructures/v1/legalEmployers/300000046740247?$effectiveDate=2025-05-13"
                        }
                    }
                }
            },
            "workRelationship": {
                "id": "100000329414679",
                "$id": "100000329414679",
                "$context": {
                    "etag": "1"
                }
            }
        },
        {
            "id": "300000795670049",
            "assignmentType": "E",
            "assignmentStatusType": "ACTIVE",
            "effectiveStartDate": "2018-05-28",
            "effectiveEndDate": "4712-12-31",
            "businessTitle": "Civil Engineer-6864",
            "workAtHomeFlag": false,
            "assignmentNumber": "EHDLWorker_190903_11128",
            "timeUpdated": "2025-05-06T11:42:25.787Z",
            "$id": "300000795670049",
            "$context": {
                "etag": "89"
            },
            "personDetail": {
                "personNumber": "HDLWorker_190903_11128",
                "$id": "100000329383875",
                "$context": {
                    "etag": ""
                }
            },
            "globalName": {
                "firstName": "Charlotte-Pénélope",
                "lastName": "Beer-Tröst",
                "$id": "300000795669677",
                "$context": {
                    "etag": ""
                }
            },
            "department": {
                "id": "300000044582197",
                "name": "Human Resources-GROUP/AT081000101",
                "title": null,
                "$id": "300000044582197",
                "$context": {
                    "etag": "13",
                    "links": {
                        "$self": {
                            "href": "https://example.com/api/boss/data/objects/ora/hcmHrCore/workStructures/v1/departments/300000044582197?$effectiveDate=2025-05-13"
                        }
                    }
                }
            },
            "legalEmployer": {
                "id": "300000046740247",
                "name": "PSR_US_LE_1",
                "$id": "300000046740247",
                "$context": {
                    "etag": "15",
                    "links": {
                        "$self": {
                            "href": "https://example.com/api/boss/data/objects/ora/hcmHrCore/workStructures/v1/legalEmployers/300000046740247?$effectiveDate=2025-05-13"
                        }
                    }
                }
            },
            "workRelationship": {
                "id": "100000329453488",
                "$id": "100000329453488",
                "$context": {
                    "etag": "1"
                }
            }
        },
        ...
    ],
    "hasMore": true
}

任务 3:提交提取职务请求

定义查询后,可以使用作业调度程序 API 提交提取作业请求。

URL /api/saas-batch/jobscheduler/v1/jobRequests
HTTP 方法 POST
请求模板
{
    "jobDefinitionName": "AsyncDataExtraction",
    "serviceName": "boss",
    "requestParameters": {
        "boss.module": "{{moduleName}}",
        "boss.resource.name": "{{viewName}}",
        "boss.resource.version": "v1",
        "boss.outputFormat": "json",
        "boss.request.system.param.effectiveDate": "{{effectiveDate}}",
        "boss.advancedQuery": "{{query}}"
    }
}

boss.request.system.param.effectiveDate 是可选参数,仅当您希望检索有效截止日期与当前日期不同的数据时才应提供该参数。

响应模板

成功提交后,将返回 202 响应代码以及指向特定作业请求实例的 Location 标头和 URL。

202 Accepted
 
Location: {{jobRequestUrl}}

提取数据时分页:

虽然您可能已使用分页控件(即 limitoffset 参数),但在构建和测试查询时,您不希望提取结果受到它们的约束。提交查询时删除 limitoffset 参数的任何用法。

传递查询:

提交提取作业请求时传递的查询必须采用标准 JSON 字符串的形式。使用 $query API 端点准备和测试查询,并:
  • 转义所有双引号(“ → \”)
  • 删除任何换行符 (\n)
  • 可以减少其他空格(例如缩进)

总的来说,您想去,例如,从:

{
    "collection": {
        "limit": 100,
        "filter": "totalAmount > 10000"
    },
    "fields": [ "id", "totalAmount" ]
}

要执行以下操作:

{\"collection\": {\"filter\": \"totalAmount > 10000\"},\"fields\": [ \"id\", \"totalAmount\" ]}

范例

请求示例

POST /api/saas-batch/jobscheduler/v1/jobRequests
 
{
    "jobDefinitionName": "AsyncDataExtraction",
    "serviceName": "boss",
    "requestParameters": {
        "boss.module": "oraHcmHrCoreEmployment",
        "boss.resource.name": "workerAssignmentExtracts",
        "boss.resource.version": "v1",
        "boss.outputFormat": "json",
        "boss.advancedQuery": "{\"collection\": {\"filter\": \"primaryFlag = true and timeUpdated > '2025-05-01T00:00:00Z' and assignmentType = 'E' and !(legalEmployer.id in (10001, 10002))\"},\"fields\": [ \"id\", \"assignmentType\", \"assignmentStatusType\", \"effectiveStartDate\", \"effectiveEndDate\", \"businessTitle\", \"workAtHomeFlag\", \"assignmentNumber\", \"timeUpdated\" ],\"accessors\": {\"personDetail\": {\"fields\": [ \"personNumber\" ]},\"globalName\": {\"fields\": [ \"firstName\", \"lastName\" ]},\"department\": {\"fields\": [ \"id\", \"name\", \"title\" ]},\"legalEmployer\": {\"fields\": [ \"id\", \"name\" ]},\"workRelationship\": {\"fields\": [ \"id\" ]}}}"
    }
}

响应示例

202 Accepted
 
Location: https://example.com/api/saas-batch/jobscheduler/v1/jobRequests/42075

任务 4:检查任务完成情况

检查完成情况涉及使用作业调度程序 API 定期轮询作业请求详细信息,直到它成功完成或失败。

URL /api/saas-batch/jobscheduler/v1/jobRequests/{{jobRequestId}}
HTTP 方法 GET

顺利完成:

满足以下条件时,认为作业请求已成功完成:
属性 预期值
jobDetails.jobProgress.completed true
jobDetails.jobProgress.status SUCCEEDED

失败完成:

满足以下条件时,作业请求被视为失败。在这种情况下,jobDetails.jobProgress.message 属性将包含错误消息。
属性 预期值
jobDetails.jobProgress.status FAILED

范例

请求示例

GET /api/saas-batch/jobscheduler/v1/jobRequests/42075

响应示例

以下答复显示已提交作业的不同阶段。特别是请参见 jobProgress.statusjobProgress.completed 属性。

已接受/已入队
200 OK
 
{
    "jobDetails": {
        "jobRequestId": 42075,
        "jobRequest": {
            "jobDefinitionName": "AsyncDataExtraction",
            "serviceName": "boss",
            "systemDerivedVersion": "90",
            "jobSubmitter": "TM-MFITZIMMONS",
            "requestParameters": {
                "boss.module": "oraHcmHrCoreEmployment",
                "boss.resource.name": "workerAssignmentExtracts",
                "boss.resource.version": "v1",
                "boss.outputFormat": "json",
                "boss.advancedQuery": "{\"collection\": {\"filter\": \"primaryFlag = true and timeUpdated > '2025-05-01T00:00:00Z' and assignmentType = 'E' and !(legalEmployer.id in (10001, 10002))\"},\"fields\": [ \"id\", \"assignmentType\", \"assignmentStatusType\", \"effectiveStartDate\", \"effectiveEndDate\", \"businessTitle\", \"workAtHomeFlag\", \"assignmentNumber\", \"timeUpdated\" ],\"accessors\": {\"personDetail\": {\"fields\": [ \"personNumber\" ]},\"globalName\": {\"fields\": [ \"firstName\", \"lastName\" ]},\"department\": {\"fields\": [ \"id\", \"name\", \"title\" ]},\"legalEmployer\": {\"fields\": [ \"id\", \"name\" ]},\"workRelationship\": {\"fields\": [ \"id\" ]}}}"
            },
            "jobRetryNumber": 0,
            "timeoutThreshold": 14400
        },
        "jobStatus": "ENQUEUED",
        "jobProgress": {
            "status": "ACCEPTED",
            "message": "Job is submitted",
            "startTime": "2025-05-25T13:39:01Z",
            "endTime": "2025-05-25T13:39:15Z",
            "completedPercentage": "0",
            "completed": false
        }
    },
    "$context": {
        "links": {
            "$self": {
                "href": "https://example.com/api/saas-batch/jobscheduler/v1/jobRequests/42075"
            }
        }
    }
}
正在运行
200 OK
 
{
    "jobDetails": {
        "jobRequestId": 42075,
        "jobRequest": {
            "jobDefinitionName": "AsyncDataExtraction",
            "serviceName": "boss",
            "systemDerivedVersion": "90",
            "jobSubmitter": "TM-MFITZIMMONS",
            "requestParameters": {
                "boss.module": "oraHcmHrCoreEmployment",
                "boss.resource.name": "workerAssignmentExtracts",
                "boss.resource.version": "v1",
                "boss.outputFormat": "json",
                "boss.advancedQuery": "{\"collection\": {\"filter\": \"primaryFlag = true and timeUpdated > '2025-05-01T00:00:00Z' and assignmentType = 'E' and !(legalEmployer.id in (10001, 10002))\"},\"fields\": [ \"id\", \"assignmentType\", \"assignmentStatusType\", \"effectiveStartDate\", \"effectiveEndDate\", \"businessTitle\", \"workAtHomeFlag\", \"assignmentNumber\", \"timeUpdated\" ],\"accessors\": {\"personDetail\": {\"fields\": [ \"personNumber\" ]},\"globalName\": {\"fields\": [ \"firstName\", \"lastName\" ]},\"department\": {\"fields\": [ \"id\", \"name\", \"title\" ]},\"legalEmployer\": {\"fields\": [ \"id\", \"name\" ]},\"workRelationship\": {\"fields\": [ \"id\" ]}}}"
            },
            "jobRetryNumber": 0,
            "timeoutThreshold": 14400
        },
        "jobStatus": "RUNNING",
        "jobProgress": {
            "jobRequestId": 42075,
            "status": "RUNNING",
            "message": "Job status is changed to RUNNING",
            "startTime": "2025-05-25T13:39:27Z",
            "endTime": "2025-05-25T13:40:25Z",
            "completedPercentage": "50",
            "completed": false
        }
    },
    "$context": {
        "links": {
            "$self": {
                "href": "https://example.com/api/saas-batch/jobscheduler/v1/jobRequests/42075"
            }
        }
    }
}
200 OK
 
{
    "jobDetails": {
        "jobRequestId": 42075,
        "jobRequest": {
            "jobDefinitionName": "AsyncDataExtraction",
            "serviceName": "boss",
            "systemDerivedVersion": "90",
            "jobSubmitter": "TM-MFITZIMMONS",
            "requestParameters": {
                "boss.module": "oraHcmHrCoreEmployment",
                "boss.resource.name": "workerAssignmentExtracts",
                "boss.resource.version": "v1",
                "boss.outputFormat": "json",
                "boss.advancedQuery": "{\"collection\": {\"filter\": \"primaryFlag = true and timeUpdated > '2025-05-01T00:00:00Z' and assignmentType = 'E' and !(legalEmployer.id in (10001, 10002))\"},\"fields\": [ \"id\", \"assignmentType\", \"assignmentStatusType\", \"effectiveStartDate\", \"effectiveEndDate\", \"businessTitle\", \"workAtHomeFlag\", \"assignmentNumber\", \"timeUpdated\" ],\"accessors\": {\"personDetail\": {\"fields\": [ \"personNumber\" ]},\"globalName\": {\"fields\": [ \"firstName\", \"lastName\" ]},\"department\": {\"fields\": [ \"id\", \"name\", \"title\" ]},\"legalEmployer\": {\"fields\": [ \"id\", \"name\" ]},\"workRelationship\": {\"fields\": [ \"id\" ]}}}"
            },
            "jobRetryNumber": 0,
            "timeoutThreshold": 14400
        },
        "jobStatus": "RUNNING",
        "jobProgress": {
            "jobRequestId": 42075,
            "status": "RUNNING",
            "message": "Publishing BOSS job progress: JobProgress(jobRequestId=42075, resourcePath=oraHcmHrCoreEmployment/v1/workers, dataDocName=null, deploymentId=null, jobStatus=RUNNING, startTime=2025-05-25T13:40:18Z, endTime=2025-05-25T13:40:38Z, completedPercentage=30, completed=false, error=null)",
            "startTime": "2025-05-25T13:40:40Z",
            "endTime": "2025-05-25T13:40:40Z",
            "completedPercentage": "30",
            "completed": false
        }
    },
    "$context": {
        "links": {
            "$self": {
                "href": "https://example.com/api/saas-batch/jobscheduler/v1/jobRequests/42075"
            }
        }
    }
}
成功完成
200 OK
 
{
    "jobDetails": {
        "jobRequestId": 42075,
        "jobRequest": {
            "jobDefinitionName": "AsyncDataExtraction",
            "serviceName": "boss",
            "systemDerivedVersion": "90",
            "jobSubmitter": "TM-MFITZIMMONS",
            "requestParameters": {
                "boss.module": "oraHcmHrCoreEmployment",
                "boss.resource.name": "workerAssignmentExtracts",
                "boss.resource.version": "v1",
                "boss.outputFormat": "json",
                "boss.advancedQuery": "{\"collection\": {\"filter\": \"primaryFlag = true and timeUpdated > '2025-05-01T00:00:00Z' and assignmentType = 'E' and !(legalEmployer.id in (10001, 10002))\"},\"fields\": [ \"id\", \"assignmentType\", \"assignmentStatusType\", \"effectiveStartDate\", \"effectiveEndDate\", \"businessTitle\", \"workAtHomeFlag\", \"assignmentNumber\", \"timeUpdated\" ],\"accessors\": {\"personDetail\": {\"fields\": [ \"personNumber\" ]},\"globalName\": {\"fields\": [ \"firstName\", \"lastName\" ]},\"department\": {\"fields\": [ \"id\", \"name\", \"title\" ]},\"legalEmployer\": {\"fields\": [ \"id\", \"name\" ]},\"workRelationship\": {\"fields\": [ \"id\" ]}}}"
            },
            "jobRetryNumber": 0,
            "timeoutThreshold": 14400
        },
        "jobStatus": "SUCCEEDED",
        "jobProgress": {
            "jobRequestId": 42075,
            "status": "SUCCEEDED",
            "message": "Job status is changed to SUCCEEDED",
            "startTime": "2025-05-25T13:39:27Z",
            "endTime": "2025-05-25T13:41:26Z",
            "completedPercentage": "100",
            "completed": true
        }
    },
    "$context": {
        "links": {
            "$self": {
                "href": "https://example.com/api/saas-batch/jobscheduler/v1/jobRequests/42075"
            }
        }
    }
}

任务 5:提取提取输出详细信息

作业成功完成后,可以提取其输出文件信息。它涉及将作业文件管理器 API 用于特定的提取作业请求实例。

输出存储在压缩块中。

URL /api/saas-batch/jobfilemanager/v1/jobRequests/{{jobRequestId}}/outputFiles
HTTP 方法 GET

文件大小:

文件大小在 items.fileSize 响应属性中返回并用字节表示。

机箱链接:

实际文件内容的 URL 将在 items.$context.links.enclosure 响应属性中返回。

范例

请求示例

GET /api/saas-batch/jobfilemanager/v1/jobRequests/42075/outputFiles

响应示例

在下面的示例中,完整输出存储在两个压缩文件中。

200 OK
 
{
    "items": [
        {
            "fileName": "result_1_json.zip",
            "fileSize": 9390419,
            "timeCreated": "2025-04-22T22:04:22.667Z",
            "$context": {
                "links": {
                    "enclosure": {
                        "href": "https://example.com/api/saas-batch/jobfilemanager/v1/jobRequests/40071/outputFiles/result_1_json.zip/content"
                    },
                    "$self": {
                        "href": "https://example.com/api/saas-batch/jobfilemanager/v1/jobRequests/40071/outputFiles/result_1_json.zip"
                    }
                }
            }
        },
        {
            "fileName": "result_2_json.zip",
            "fileSize": 4462724,
            "timeCreated": "2025-04-22T22:04:36.565Z",
            "$context": {
                "links": {
                    "enclosure": {
                        "href": "https://example.com/api/saas-batch/jobfilemanager/v1/jobRequests/40071/outputFiles/result_2_json.zip/content"
                    },
                    "$self": {
                        "href": "https://example.com/api/saas-batch/jobfilemanager/v1/jobRequests/40071/outputFiles/result_2_json.zip"
                    }
                }
            }
        }
    ],
    "totalItems": 2,
    "$context": {
        "links": {
            "$self": {
                "href": "https://example.com/api/saas-batch/jobfilemanager/v1/jobRequests/40071/outputFiles"
            }
        }
    }
}

任务 6:下载提取输出

最后,可以使用作业文件管理器 API 为特定提取作业请求实例和输出文件下载提取输出文件。

URL /api/saas-batch/jobfilemanager/v1/jobRequests/{{jobRequestId}}/outputFiles/{{fileName}}/content
HTTP 方法 GET

提示:

如果需要,您可以通过使用范围 HTTP 头实现多线程下载来更有效地下载大文件,如下所示。

Range: {{startByte}}-{{endByte}}/{{fileSize}}

范例

请求示例

GET /api/saas-batch/jobfilemanager/v1/jobRequests/42075/outputFiles/result_42075.json/content

响应示例

实际响应是二进制压缩文件内容。解压缩后,它将完整或部分(如果是 Range 标头使用情况)、未格式化的 JSON 有效负载以及提取查询的完整或部分(如果是文件块)结果。

完全未压缩的结果示例
{"items": [
    {"id":"300008335145001","assignmentType":"E","assignmentStatusType":"ACTIVE","effectiveStartDate":"2025-05-02","effectiveEndDate":"4712-12-31","businessTitle":"E7356262523","workAtHomeFlag":false,"assignmentNumber":"E7356262523","timeUpdated":"2025-05-01T07:53:15.722Z","$id":"300008335145001","$context":{"etag":"1"},"personDetail":{"personNumber":"7356262523","$id":"300008335144985","$context":{"etag":""}},"globalName":{"firstName":null,"lastName":"oracle","$id":"300008335144986","$context":{"etag":""}},"department":null,"legalEmployer":{"id":"300001939234024","name":"AORT Oracle United States","$id":"300001939234024","$context":{"etag":"6","links":{"$self":{"href":"/ora/hcmHrCore/workStructures/v1/$en-US/legalEmployers/300001939234024?$effectiveDate=2025-05-13"}}}},"workRelationship":{"id":"300008335144995","$id":"300008335144995","$context":{"etag":"1"}}},
    {"id":"300000310085281","assignmentType":"E","assignmentStatusType":"ACTIVE","effectiveStartDate":"2018-03-04","effectiveEndDate":"4712-12-31","businessTitle":"Medical Technologist Corporate Level-35321","workAtHomeFlag":false,"assignmentNumber":"EHDLWorker_190409_467490","timeUpdated":"2025-05-07T15:29:46.59Z","$id":"300000310085281","$context":{"etag":"90"},"personDetail":{"personNumber":"HDLWorker_190409_467490","$id":"100000127293313","$context":{"etag":""}},"globalName":{"firstName":"Martin-David","lastName":"Oestrovsky-Krein","$id":"300000310075057","$context":{"etag":""}},"department":{"id":"300000041568062","name":"GFIN Global Controlling-GROUP/GFINGC74155","title":null,"$id":"300000041568062","$context":{"etag":"13","links":{"$self":{"href":"/ora/hcmHrCore/workStructures/v1/$en-US/departments/300000041568062?$effectiveDate=2025-05-13"}}}},"legalEmployer":{"id":"300000046740247","name":"PSR_US_LE_1","$id":"300000046740247","$context":{"etag":"15","links":{"$self":{"href":"/ora/hcmHrCore/workStructures/v1/$en-US/legalEmployers/300000046740247?$effectiveDate=2025-05-13"}}}},"workRelationship":{"id":"100000127362395","$id":"100000127362395","$context":{"etag":"1"}}}
]}

更多学习资源

通过 docs.oracle.com/learn 浏览其他实验室,或者通过 Oracle Learning YouTube 频道访问更多免费学习内容。此外,请访问 education.oracle.com/learning-explorer 以成为 Oracle Learning Explorer。

有关产品文档,请访问 Oracle 帮助中心