GwEnrichEvent()

GwEnrichEvent(); 更新事件中的字段。 任何数据都可以使用此规则添加到事件中;然而,只有那些在输出字段过滤器中列出的字段才允许更新 alerts.status , EventGatewaySchema nco2ncp FieldFilter所定义的那样。

语法

GwEnrichEvent(); 语句使用以下语法。

GwEnrichEvent ( [optional serial number], enrichedFields );

参数

下表列出此编排器规则的参数的属性。
表 1. GwEnrichEvent(参数
参数 描述 接受常量 接受变量 接受 eval 子句
optional serial number 标识要更新的事件。 如果未提供序列号,那么假定正在更新当前顶级作用域内事件。 如果迭代循环 (例如, RecordList的内容) ,那么该事件仍是在编排器启动时作用域内的顶级事件,而不是循环中的当前作用域内记录。
注: 事件网关编排器始终将事件作为顶级作用域内记录。
enrichedFields 记录列出用于丰富事件的字段。 这些字段将添加到事件或更新事件中的现有字段。

退货

此拼合器不会返回任何值。

更新当前作用域内事件

以下示例显示如何使用 GwEnrichEvent(); 规则来更新当前作用域内的记录。
指定为扩充记录一部分的两个字段都将添加到当前作用域内记录。 然而,实际上只有alerts.status MyCustomField在ObjectServer更新,因为 FieldUsedByRca在传出字段过滤器中未列为允许字段。
// define the fields to add or update
Record enrichment;
@enrichment.MyCustomfield = "any value I choose for this text field";
@enrichment.FieldUsedByRca = 59;

GwEnrichEvent( enrichment );

使用指定序列号更新事件

以下示例显示如何使用 GwEnrichEvent(); 规则来更新具有指定序列号的事件。 此示例与上一个示例完全相同,只是当且仅当其序列号为 345 时,才会修改顶级作用域内记录。 如果事件没有序列号 345 ,那么将针对该序号更新 alerts.status 表,但作用域内记录保持不变。
// define the fields to add or update
Record enrichment;
@enrichment.MyCustomfield = "any value I choose for this text field";
@enrichment.FieldUsedByRca = 59;

GwEnrichEvent( 345, enrichment );