用途:当需要为 Salesforce 体验创建可复用 UI 片段(Fragment)时使用本技能,包括生成符合 UEM(Unified Experience Model)结构的 Fragment 元数据、为 Slack、Mobile、LEX 等体验构建片段,以及排查与 Fragment 相关的部署错误。
主要能力:Fragment 是类似模板的可复用 UI 单元,含数据占位符,用于在多种 Salesforce 体验中统一渲染数据。片段由块(block)与区域(region)组成的 UEM 树构成,需遵循 TypeScript 接口:BlockType 含 type、definition({namespace}/{blockName})、可选 attributes 与 children;RegionType 含 type、name 与 children。
使用方式:提供两个元数据操作。discoverUiComponents 用于发现可用块,参数 pageType 必填为 "FRAGMENT",pageContext 对 FRAGMENT 非必需,searchQuery 可选用于按名称或描述过滤,返回 definition、description、label 及可选 attributes。getUiComponentSchemas 用于获取组件配置的 JSON Schema,参数 pageType 必填为 "FRAGMENT",componentDefinitions 必填为完全限定名列表,includeKnowledge 可选默认 true,返回 componentSchemas(支持部分失败)与 $defs。典型流程:先用 discoverUiComponents 探索可用块,可选用 searchQuery 过滤;选定组件并记录完全限定定义;再用 getUiComponentSchemas 查看必填与可选属性;最后按 UEM 树结构构建 Fragment 并配置属性。
限制与注意:块定义始终遵循 {namespace}/{blockName} 约定;调用 getUiComponentSchemas 时应使用 discoverUiComponents 返回的相同定义格式;FRAGMENT 页面类型不需要额外 pageContext;Schema 同时包含必填与可选属性,需仔细核对以确保配置有效。资料未提供具体收费、价格、平台支持范围或效果数据。