エージェント記述子の完成
エージェント記述子 (agent.adsc) を指定して、 エージェントをバインドするエンティティー、エージェントで処理するイベント、およびルーティング・ロジックを定義する必要があります。
始める前に
このタスクについて
エージェント記述子ファイルで、イベントに適用するルーティング条件を定義します。ビジネス・モデルのイベント・タイプおよびエンティティー・タイプを参照するビジネス語彙が、記述子にあります。
このエージェント記述子ファイルには、エージェント・ロジックを定義するためにエディターで入力する必要があるテンプレートが含まれます。
手順
タスクの結果
次のエージェント記述子は、airport エンティティーにバインドされ、2 つのイベントを処理する airport agent を示しています。

- エージェントの名前。
- バインド・エンティティーのタイプ。
- エージェントの優先度。
- エージェントが listen し、処理するイベント・タイプ。
- バインド・エンティティー。
- イベント内のバインド・エンティティーに対応するストリングを取得する式。
- イベントのフィルタリング。
- イベント期間。
エージェント記述子は、ルール内のエンティティーとイベントを参照するための変数を提供する、オーサリング・コンテキストを設定します。例えば、バインド・エンティティーが a flight の場合、エージェントのルール内では、エンティティーは 'the flight' と呼ばれます。
- temperature reading,
where this location comes from the location of this temerature reading
with a horizon of 7 days
1 週間後に、過去 7 日間の温度読み取りがエージェントに保管されます。
次に、このデータを集約する次のルールを追加することができます。
when a temperature reading event occurs,
define 'average temperature' as the average degrees of temperature readings over the last period of 1 week;
if
'average temperature' is more than 25
then
emit a new temperature warning
例
- 1 つのイベントを処理するエージェント
- 次の例では、エージェントのバインド・エンティティーが ticket で、エージェントが ticket check-in event を listen します。
ticket エンティティーの ID は、ticket check-in event に含まれる ID です。
'ticket checkin agent' is an agent related to a ticket, processing events: - ticket checkin event, where this ticket comes from the ticket of this ticket checkin eventヒント: target プレースホルダーでは、イベントを暗黙的に参照する変数を使用できます。例えば、the ticket of this ticket checkin event と記述する代わりに、the ticket と記述することができます。 - 優先度と条件を持つ複数のイベントを処理するエージェント
次のエージェント記述子は、airport エンティティーにバインドされ、2 つのイベントを処理する airport agent を示しています。 エージェントの優先度は high です。 優先度の低い別のエージェントが同じイベントを listen している場合、AirportAgent エージェントが先にそれらのイベントを処理します。このエージェント記述には、airport open event のフィルター条件も含まれています。 エージェントは、8 月に発生した airport open event だけを処理します。
'AirportAgent' is an agent related to an airport, whose priority is High, processing events: - airport closed event, where this airport comes from the airport of this airport closed event - airport open event when the datetime of this airport open event is in August, where this airport comes from the airport of this airport open event- 複数のイベントを処理するエージェント (イベントの 1 つには期間が指定されています)
- 次のエージェント記述子は、airport エンティティーにバインドされ、2 つのイベントを処理する airport agent を示しています。
エージェントは、各イベントのタイム・スタンプを基準にして、そこから 15 日間、airport open event を作業メモリー内に保持します。現在時刻がこの期間の終わりに達すると、airport open event はエージェントのメモリーから削除されます。エージェント記述子に airport closed event の期間は指定されていないため、それらのイベントはエージェントまたはソリューションの最大期間にわたって作業メモリー内に保持されます。
'AirportAgent' is an agent related to an airport, processing events: - airport closed event, where this airport comes from the airport of this airport closed event - airport open event, where this airport comes from the airport of this airport open event with a horizon of 15 days - エンティティー ID がイベントの 2 つのフィールドに基づくイベントを処理するエージェント
- 次の例では、エージェントのバインド・エンティティーが customer で、エージェントが subscription event を listen します。
customer エンティティーの ID は、subscription event に含まれる main contact の first name と last name から構成されます。
'subscription agent' is an agent related to a customer, processing events: - subscription event, where this customer comes from the first name of the main contact of this subscription event + "/" + the last name of the main contact of this subscription event
次のタスク
ルール・エージェントのエージェント記述子が完成したら、ルールを作成してエージェントのビジネス・ロジックを定義できます。