Custom Business Event コンポーネント

Custom Business Event コンポーネント (XML ビューの ​tracking:custom-event​ 要素) を使用して、メタデータおよび重要業績評価指標 (KPI) をフローに追加します。次の手順に従って、コンポーネントを設定します。

  1. Anypoint Studio の ​[Mule Palette (Mule パレット)]​ タブをクリックします。

  2. [Custom Business Event]​ をフローの任意の位置にドラッグします。

  3. コンポーネントのプロパティビューを開き、​[Display Name (表示名)]​ と ​[Event Name (イベント名)]​ の値を指定します。

    custom-business-event

重要業績評価指標 (KPI) を設定して、メッセージペイロードから情報を取得することもできます。

  • UI では、次の手順を実行します。

    1. [Key Performance Indicators (重要業績指標)]​ 内のプラスボタン (2%) をクリックします。

    2. [Name (名前)]​ と ​[Expression / Value (式 / 値)]​ を設定します。

      business-events-kpi
  • XML では、次の手順を実行します。

    1. 子要素 ​tracking:meta-data​ を ​tracking:custom-event​ に追加します。

    2. tracking:meta-data​ 内の ​key​ 属性と ​value​ 属性を設定します。

      次に例を示します。

      <tracking:custom-event doc:name="Custom Business Event" event-name="New order">
      			<tracking:meta-data key="order-id" value="#[payload.order.header.orderID]" />
      </tracking:custom-event>

KPI については、Anypoint Runtime Manager インターフェースで容易に検索できる名前を使用し、代表値を使用します (任意の Mule 式を使用できます)。

名前 Expression / Value (式 / 値)

employee-id

#[payload['ID']]

employee-email

#[payload['Email']]

employee-git-id

#[payload['GITHUB_ID']]

price

700

price-after-discount

#[vars.price]

order-id

#[payload.order.header.orderID]