簡介
雲端 HCM 提供使用具有唯讀資料存放區的新一代平台,從 HCM 擷取資料的功能。
目標
完成本教學課程後,您將瞭解如何:
- 查詢職工擷取檢視與其物件階層
- 非同步提交與追蹤擷取工作要求,以擷取選取的職工階層資料
- 下載擷取輸出檔案
必要條件
在您開始之前:
- 請洽詢 Oracle CoE,確定您的 Pod 中已佈建唯讀資料存放區,並且正在複製您的資料
- 執行必要的安全組態,包括:
- 資料安全性設定
- OAuth 用戶端應用程式設定
使用案例
此功能可讓您解決下列使用案例。
完整資料擷取
職工資料的完整擷取可以是一次性或定期活動。
您可以擷取整個物件階層或僅擷取其子集。
完整資料擷取會擷取符合篩選準則的所有記錄,而輸出檔案可能會非常大。
系統將從要求的生效日期擷取生效日期,其中預設為目前擷取日期。
增量資料擷取
職工資料的遞增擷取通常是定期的排定活動。
您可以擷取整個物件階層或僅擷取其子集。
在此使用案例中,您只要擷取自上次擷取執行後變更的物件,其中第一個擷取執行是基準線。若要達到此目的,必須將 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 | ID fromDate toDate emailAddress timeUpdated updatedBy timeCreated createdBy primaryFlag personDetail.id personDetail.personNumber personDetail.effectiveStartDate personDetail.effectiveEndDate type.lookupCode type.lookupType type.meaning |
| legislativeInformationExtracts | ID effectiveStartDate effectiveEndDate 性別 maritalStatus maritalStatusChangeDate highestEducationLevel timeUpdated updatedBy timeCreated createdBy personDetail.id personDetail.personNumber personDetail.effectiveStartDate personDetail.effectiveEndDate legislation.territoryCode legislation.territoryShortName |
| legislativeInformationHistoryExtracts | ID 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 | ID 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 | id effectiveStartDate effectiveEndDate type primaryFlag timeCreated timeUpdated createdBy updatedBy 組建 floorNumber townOrCity postalCode longPostalCode addressLine1 addressLine2 addressLine3 addressLine4 county state province country.territoryCode country.territoryShortName |
| personTypeExtracts | ID systemPersonType activeFlag defaultFlag timeCreated timeUpdated createdBy updatedBy userPersonType |
| phoneExtracts | ID 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 |
全域 HR - 工作結構
| 模組名稱 | 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 | ID createdBy effectiveStartDate effectiveEndDate 代碼 timeCreated timeUpdated updatedBy 狀態 countryCode employeeLocationFlag shipToSiteFlag receivingSiteFlag billToSiteFlag officeSiteFlag detailCreatedBy detailTimeCreated detailUpdatedBy detailTimeUpdated timezoneCode 描述 名稱 |
| locationHistoryExtracts | ID 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 |
sal > 1999.99 |
| 高於或等於測試 低於或等於測試 |
field >= value |
sal >= 1999.99 |
| 樣式比對 | field LIKE 'pattern' |
job LIKE 'SALES%' |
| 會員資格測試 | field IN (value1, ..., valueN) |
deptno IN (10, 20, 40) |
| 不區分大小寫比較 | field ~= value |
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
排序
定義資料的排序方式。排序是以包含排序方向 (asc 或 desc) 的排序屬性陣列來表示。舉例而言:
"sortBy": [
{
"totalAmount": "desc"
},
{
"paidAmount": "asc"
}
]
分頁
定義資料分頁的方式。從屬端可以提供限制和偏移參數來控制分頁。舉例而言:
"limit": 200, "offset": 400
預設限制為 25,上限為 1000。
預設偏移量為 0,代表結果的開頭。
回應中的最上層 hasMore 屬性會指出是否有更多要擷取的結果。
不應使用分頁作為擷取資料的替代方式。查詢此 API 時,無法保證資料不會在要求之間變更。使用非同步 API 擷取資料。
範例
下方的範例擷取查詢旨在擷取指派資訊以及法定雇主與部門詳細資料,如下所示:
- 是主要指派
- 類型為 Employee
- 不屬於 ID 為
10001與10002的法定雇主 - 自擷取日期起生效
- 自上次執行後已更新 (或已建立)
要求範例
請注意具有上一個擷取執行之時戳的 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}}"
}
}
|
| 回應樣板 |
成功提交時,會傳回 202 Accepted
Location: {{jobRequestUrl}}
|
擷取資料時的分頁:
雖然您可能已使用分頁控制項 (例如limit 和 offset 參數),但在建置和測試查詢時,您不想讓擷取結果受到限制。送出查詢時,請移除 limit 和 offset 參數的任何用法。
通過查詢:
送出擷取工作要求時所傳送的查詢必須是標準 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.status 和 jobProgress.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 |
秘訣:
如有需要,您可以使用 Range 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 Help Center 。