service-omni-service-channel-configure
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseservice-omni-service-channel-configure
service-omni-service-channel-configure
Ensure exactly one is present for a routable sObject, reusing whatever is already bound (Salesforce standard or a pre-existing custom channel) and deploying the skill's canonical v66 template only when none exists. Salesforce enforces one ServiceChannel per , so the skill detects first and never deploys blindly — deploying a second channel for an sObject that already has one fails with "This Salesforce object is already in use by another Service channel." It handles one sObject per call; callers configuring multiple sObjects invoke it once for each sObject, after has enabled Omni-Channel.
ServiceChannelRelatedEntityservice-omni-base-settings-configure| sObject | Standard channel (if any) | Canonical asset |
|---|---|---|
| | |
| none (Incident Management sObject) | |
| | |
| | |
确保可路由sObject仅存在一个,重用已绑定的任何渠道(Salesforce标准渠道或预先存在的自定义渠道),仅在不存在渠道时部署该技能的v66规范模板。Salesforce强制每个对应一个ServiceChannel,因此该技能会先进行检测,绝不会盲目部署——如果为已存在渠道的sObject部署第二个渠道,会失败并提示“此Salesforce对象已被另一个服务渠道使用。”每次调用仅处理一个sObject;配置多个sObject的调用方需为每个sObject调用一次该技能,且需在启用Omni-Channel之后调用。
ServiceChannelRelatedEntityservice-omni-base-settings-configure| sObject | 标准渠道(如有) | 规范资产 |
|---|---|---|
| | |
| 无(事件管理sObject) | |
| | |
| | |
Inputs
Inputs
bash
bash scripts/deploy-and-report.sh <org-alias> [Case|Incident|MessagingSession|VoiceCall]- (required).
org-alias - (optional, default
sobject_type) — one ofCase.Case | Incident | MessagingSession | VoiceCall
bash
bash scripts/deploy-and-report.sh <org-alias> [Case|Incident|MessagingSession|VoiceCall]- (必填)。
org-alias - (可选,默认值
sobject_type)——可选值为Case。Case | Incident | MessagingSession | VoiceCall
Preconditions and safety
前置条件与安全要求
- Target org authenticated via CLI (My Domain URL), Service Cloud license,
sfCLI ≥ 2.139.6.sf - Omni-Channel base settings enabled () —
service-omni-base-settings-configureis only queryable/writable whenServiceChannel; aenableOmniChannel=trueon deploy means base settings are off.INVALID_TYPE - requires the Incident Management feature enabled;
Incidentrequires Enhanced Messaging. The skill verifiesMessagingSessionfirst and blocks with a click-path when the target sObject is absent.EntityDefinition
- 目标组织已通过CLI(我的域名URL)完成身份验证,拥有Service Cloud许可证,
sfCLI版本≥2.139.6。sf - Omni-Channel基础设置已启用()——仅当
service-omni-base-settings-configure时,enableOmniChannel=true才可查询/写入;部署时出现ServiceChannel错误意味着基础设置未开启。INVALID_TYPE - 要求启用事件管理功能;
Incident要求启用增强消息功能。该技能会先验证MessagingSession,若目标sObject不存在则通过点击路径阻止操作。EntityDefinition
Run
运行方式
deploy-and-report.sh- Prereq — confirm the target sObject is queryable via ; block with a click-path otherwise.
EntityDefinition - Discover — query the Tooling API for a with
ServiceChannel.RelatedEntity = <sobject_type>is a Tooling entity on v66; the standard Data API returnsServiceChannel. A hit means reuse.INVALID_TYPE - Deploy (only when nothing was found) — of the canonical XML (
sf project deploy start|Cases|Incidents|MessagingSessions); aVoiceCallsstate isChanged,createdisUnchanged.reused
deploy-and-report.sh- 前置检查——通过确认目标sObject可查询;否则通过点击路径阻止操作。
EntityDefinition - 发现——通过Tooling API查询的
RelatedEntity = <sobject_type>。v66版本中ServiceChannel是Tooling实体;标准Data API会返回ServiceChannel。若查询到结果则重用该渠道。INVALID_TYPE - 部署(仅在未找到渠道时执行)——使用部署规范XML文件(
sf project deploy start|Cases|Incidents|MessagingSessions);状态为VoiceCalls表示“已创建”,Changed表示“已重用”。Unchanged
Behavior
行为逻辑
Detect-then-reuse-or-deploy. Because Salesforce rejects a second channel per , deploy-first is unsafe: an operator who renamed the standard channel would hit the "already in use" error instead of gracefully reusing. Tooling discovery is fast and returns both the reuse decision and the discovered in one call. The trade-off is that the skill cannot tell "our canonical shape matches" from "some custom channel is bound" — an operator with a non-canonical channel gets and their channel is left untouched (v1 never overwrites operator state).
RelatedEntityCasesDeveloperNamereusedCapacity model. The canonical assets use for every variant. requires companion fields whose full schema is undocumented, so it is out of scope; per-agent capacity tuning belongs to , not this skill.
TAB_BASEDSTATUS_BASEDPresenceUserConfig.CapacityConcurrency. If a deploy fails with "already in use," another process created the channel between discovery and deploy; the skill soft-fails and a re-run reuses it.
先检测,再重用或部署。由于Salesforce不允许每个对应多个渠道,先部署的方式不安全:如果操作人员重命名了标准渠道,会触发“已被使用”错误,而非优雅地重用该渠道。Tooling发现操作速度快,一次调用即可返回重用决策和已发现的。权衡之处在于,该技能无法区分“渠道符合规范形态”和“绑定了某个自定义渠道”——拥有非规范渠道的操作人员会得到“已重用”状态,其渠道会保持原样(v1版本绝不会覆盖操作人员的配置)。
RelatedEntityCasesDeveloperName容量模型。规范资产的所有变体均使用。需要配套字段,但其完整架构未公开,因此不在本技能的范围内;针对每个Agent的容量调整属于的范畴,与本技能无关。
TAB_BASEDSTATUS_BASEDPresenceUserConfig.Capacity并发处理。如果部署失败并提示“已被使用”,说明在发现操作和部署操作之间,另一个进程创建了该渠道;此时技能会软失败,重新运行即可重用该渠道。
Output contract
输出约定
A single JSON object per invocation with ∈ | | , plus , , , , , , , , , and .
statuscreatedreusedblockedsobject_typechannel_developer_namechannel_idchannel_origintarget_capacity_modeltarget_related_entity_typebefore_statedeploy_idmanual_actionsblocking_issue- — an existing channel was found (discovery hit, or a deploy returned
reused).Unchanged - — no channel existed; the canonical XML deployed with
created.Changed - — the sObject is not on the org, base settings are off (
blocked), or a race left the channel already in use.INVALID_TYPE - is one of
channel_origin(ansalesforce_standardname orsfdc_*),Cases(a shipped asset name),canonical_asset(freshly deployed this run), orcanonical_template(a pre-existing org-specific channel).custom - is populated whenever a channel exists (
channel_idonnull);blockedis populated only on the deploy branch;deploy_idis non-null only whenblocking_issue.status: blocked
每次调用返回一个JSON对象,其中的取值为 | | ,此外还包含、、、、、、、、和字段。
statuscreatedreusedblockedsobject_typechannel_developer_namechannel_idchannel_origintarget_capacity_modeltarget_related_entity_typebefore_statedeploy_idmanual_actionsblocking_issue- ——已找到现有渠道(发现操作命中结果,或部署返回
reused状态)。Unchanged - ——不存在渠道;规范XML已部署,状态为
created。Changed - ——sObject不在组织中、基础设置未开启(
blocked错误),或因竞态条件导致渠道已被使用。INVALID_TYPE - 的取值为
channel_origin(名称为salesforce_standard或sfdc_*)、Cases(已发布的资产名称)、canonical_asset(本次运行新部署的模板)或canonical_template(预先存在的组织特定渠道)。custom - 会在渠道存在时填充(
channel_id状态下为blocked);null仅在部署分支中填充;deploy_id仅在blocking_issue时非空。status: blocked
Limitations
局限性
- One sObject per invocation.
- Only ,
Case,Incident,MessagingSessionare supported — extend by adding anVoiceCallfile and a dispatcher branch.assets/force-app/main/default/serviceChannels/<Name>.serviceChannel-meta.xml - Always reuses an existing channel; it does not reset a mis-configured channel to canonical shape.
- 每次调用仅处理一个sObject。
- 仅支持、
Case、Incident、MessagingSession——如需扩展,需添加VoiceCall文件和调度分支。assets/force-app/main/default/serviceChannels/<Name>.serviceChannel-meta.xml - 始终重用现有渠道;不会将配置错误的渠道重置为规范形态。
References
参考资料
| File | When to read |
|---|---|
| On unexpected discovery results, deploy failures, or sObject-specific schema questions |
| 文件 | 阅读场景 |
|---|---|
| 出现意外发现结果、部署失败或sObject特定架构问题时 |