PlatformEventChannel
標準の ChangeEvents チャネルまたはカスタムチャネルの変更データキャプチャ通知に選択されたエンティティのコレクションを表します。標準チャネルは、[設定] の [変更データキャプチャ] ページのエンティティ選択に対応します。カスタムチャネルとは、PlatformEventChannel メタデータ型を使用するエンティティのグループに定義するチャネルです。変更データキャプチャでは、選択されたエンティティの作成、更新、削除、復元されたレコードの通知のみが送信されます。Metadata メタデータ型を拡張し、その fullName 項目を継承します。
ファイルのサフィックスおよびディレクトリの場所
PlatformEventChannel コンポーネントのサフィックスは .platformEventChannel で、platformEventChannels フォルダに保存されます。
バージョン
PlatformEventChannel コンポーネントは、API バージョン 45.0 以降で使用できます。
特別なアクセスルール
この型をリリースおよび取得するには、「アプリケーションのカスタマイズ」権限が必要です。
項目
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| channelMembers | PlatformEventChannelSelectedEntity[] | 標準オブジェクトとカスタムオブジェクトを含む、変更データキャプチャ通知に選択されたエンティティのイベント名のリスト。 |
| channelType | PlatformEventChannelType (string 型の列挙) | 必須。チャネル種別。有効な値は、次のとおりです。
|
| label | string | 必須。チャネルの表示ラベル。 |
PlatformEventChannelSelectedEntity
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| selectedEntity | string | 必須。変更データキャプチャ通知に選択されたエンティティのイベント名。たとえば、Account 標準オブジェクトの場合、名前は AccountChangeEvent、MyObject__c カスタムオブジェクトの場合、名前は MyObject__ChangeEvent です。 |
使用方法
PlatformEventChannel メタデータ型では createMetadata() および deleteMetadata() コールはサポートされていません。また、destructiveChange.xml をリリースして変更データキャプチャの選択すべてを削除することもできません。変更データキャプチャの選択を更新するには、更新した PlatformEventChannel 定義をリリースするか、updateMetadata() コールを使用します。
標準チャネルの宣言的なメタデータの定義のサンプル
標準の ChangeEvents チャネルのこの PlatformEventChannel コンポーネントの例には、選択した 3 つのエンティティ (Account、Contact、Employee__c カスタムオブジェクト) のイベント名が含まれています。
1<?xml version="1.0" encoding="UTF-8"?>
2<PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
3 <channelMembers>
4 <selectedEntity>AccountChangeEvent</selectedEntity>
5 </channelMembers>
6 <channelMembers>
7 <selectedEntity>ContactChangeEvent</selectedEntity>
8 </channelMembers>
9 <channelMembers>
10 <selectedEntity>Employee__ChangeEvent</selectedEntity>
11 </channelMembers>
12 <channelType>data</channelType>
13 <label>ChangeEvents</label>
14</PlatformEventChannel>この package.xml は、以前の定義を参照します。
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>ChangeEvents</members>
5 <name>PlatformEventChannel</name>
6 </types>
7 <version>46.0</version>
8</Package>カスタムチャネルの宣言的なメタデータの定義のサンプル
SalesEvents と呼ばれるカスタムチャネルのこの PlatformEventChannel コンポーネントの例には、関連する 3 つのセールスオブジェクト (取引先、取引先責任者、注文) のイベント名が含まれています。
1<?xml version="1.0" encoding="UTF-8"?>
2<PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
3 <label>Custom Channel for Sales Events</label>
4 <channelMembers>
5 <selectedEntity>AccountChangeEvent</selectedEntity>
6 </channelMembers>
7 <channelMembers>
8 <selectedEntity>ContactChangeEvent</selectedEntity>
9 </channelMembers>
10 <channelMembers>
11 <selectedEntity>OrderChangeEvent</selectedEntity>
12 </channelMembers>
13 <channelType>data</channelType>
14</PlatformEventChannel>この package.xml は、以前の定義を参照します。
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>SalesEvents__chn</members>
5 <name>PlatformEventChannel</name>
6 </types>
7 <version>46.0</version>
8</Package>