iterator
iterator
component: iterator. Traverse each value of msg or the specified field in msg to the next node. The traversed field must be an array
or a {key:value}
type。
# Configuration
Field name | Type | Required | Description | Default value |
---|---|---|---|---|
fieldName | string | No | Traversal field name, if empty, traverse the entire msg, support nested way to get msg field value, such as items.value, items | "" |
jsScript | string | No | JS filter script for each item, optional, default is empty, match all items | "" |
jsScript:
- function Filter(item,index,metadata)
item:
The current traversed itemindex:
If it is an array, it represents the current traversed index, if it is a map, it represents the current traversed keymetadata:
Message metadataReturn:
true means match, false means not match
# Relation Type
- True: If the item satisfies the JsScript condition, the item data will be sent to the next node through the
True
link - False: If the item does not satisfy the JsScript condition, the item data will be sent to the next node through the
False
link - Success: After the traversal is over, the original msg is sent to the next node through the
Success
link - Failure: If the specified field is not found, the js script execution fails or the traversed object is not an
array
or a{key:value}
, it is sent to theFailure
link
Edit this page on GitHub (opens new window)
Last Updated: 2024/10/23, 10:13:01