Add InspectionEventsPlugin (022) - 26A Forms and Fusion API Integration
@btoron 已经在做这个了。
开始于 2026年3月25日。
评估
这个 Issue 还没有评估数据。
描述
Description
Create a new plugin that demonstrates the OFS 26A functionality introduced in plugin-core v1.6.0. This plugin will showcase form management capabilities, environment-based token retrieval, and Fusion API integration for inspection events.
Base Template
Use ./010-TokenExample as the starting point for this plugin.
Requirements
1. Context Detection (Activity vs Inventory)
The plugin must identify whether it was opened from an activity or a piece of inventory:
From Inventory:
{
"inventory": {
"invid": "21259059"
}
}
From Activity:
The message will contain the activity element with full activity data.
2. Form Workflow
- Receive
openParamscontaining the label of the form to be opened - Open the form using the new 26A methods, passing:
activityId(when opened from an activity)inventoryId(when opened from an inventory)formLabel(from openParams)
- After form submission, retrieve the
formsSubmittedlist usinggetSubmittedForms()
3. Token Retrieval for Fusion APIs
If a form has been submitted:
- Build the scope using the
environmentgetter (new in v1.6.0)- Use
OFSEnvironmentproperties:environmentName,fsUrl,faUrl
- Use
- Retrieve token using
getAccessTokenByScope()procedure - Use the token to invoke Fusion APIs
4. Fusion API Integration - Inspection Events
Step 1: Create Inspection Event
Endpoint: POST /fscmRestApi/resources/latest/inspectionEvents
Payload:
{
"EventType": "AST",
"Inline": "N",
"InspectedBy": "[email protected]",
"InspectionDate": "2025-10-18T16:48:03.777+00:00",
"OrganizationCode": "11270",
"AssetWorkOrderNumber": "OCO-10510",
"AssetNumber": "OEW-SS001-PR003",
"QuantityRequested": 1,
"OperationSequenceNumber": "10",
"AssetInspectionPlanName": "OMS305A.05Y.A.PR-CD_TEST_V2",
"WoOperationCode": "OMS305A.05Y.A.PR-CD"
}
Step 2: Get Inspection Event Details
Endpoint: GET /fscmRestApi/resources/latest/inspectionEvents
Retrieves the created event with IpEventId, Sample, SampleDisposition, and SampleResult data including SampleResultId and CharacteristicName.
Step 3: Update Inspection Results
Endpoint: PATCH /fscmRestApi/resources/latest/inspectionEvents/{IpEventId}
Payload: Updates SampleResult entries with ResultValueChar or ResultValueNumber based on form data.
5. Form-to-Characteristic Mapping
Critical Requirement: The name of the property in the OFS form must match the name of the characteristic in Quality Management. This enables automatic mapping between form fields and inspection characteristics.
Example mapping:
| Form Property | Quality Characteristic | Result Type |
|---|---|---|
MT 01M MAIN TANK |
MT 01M MAIN TANK |
ResultValueChar |
MT 01M OLTC COUNTER |
MT 01M OLTC COUNTER |
ResultValueNumber |
Architecture Requirements
Separation of Concerns
The Fusion API integration logic must be completely separated from the main plugin logic. This allows:
- Easy adjustment to invoke different APIs
- Reusability across plugins
- Clean testing boundaries
Suggested structure:
assets/js/
├── main.ts # Entry point
├── custom.ts # Plugin logic (context detection, form handling)
└── services/
└── fusionApi.ts # Fusion API integration (isolated)
The fusionApi.ts module should expose:
createInspectionEvent(token, payload)getInspectionEvent(token, eventId)updateInspectionResults(token, eventId, results)
New v1.6.0 Features to Demonstrate
-
OFSEnvironmentinterface (environmentName,fsUrl,faUrl) -
environmentgetter on OFSPlugin class -
getAccessTokenByScope()procedure -
closeAndOpenForm()method -
getSubmittedForms()procedure -
BackScreenenum usage
Acceptance Criteria
- Plugin correctly identifies activity vs inventory context
- Form opens with correct parameters based on context
- Token retrieval works using environment-based scope
- Inspection event creation, retrieval, and update work correctly
- Form property names map to characteristic names
- Fusion API logic is in a separate, reusable module
- README.md documents all features and configuration
- Tests cover main functionality
Labels
- enhancement
- 26A
- fusion-api
- 主要语言
- TypeScript
- 星标
- 6
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oracle-samples/ofs-sample-plugins 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 10/100
-
难度 3/5 1-2 天 新手友好度 70/100
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 35/100
查看 oracle-samples/ofs-sample-plugins 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
thecodacus/understory#61 ·
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
Termix-SSH/Plugin-Hosts-Config#14 · 1 条评论 ·
维护者通常 4 天内回复
-
ai-generated priority: p2 size: s type: bug
难度 2/5 1-3 小时 新手友好度 82/100
JonathanTSilva/jts-website#92 ·
维护者通常 1 天内回复
-
Toast announcer reads a doubled period when a toast's title ends in punctuation可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
vercel-labs/ui#999 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
ehmpathy/rhachet-roles-ehmpathy#1443 ·
维护者通常 1 天内回复