MOP 信号灯 icon

MOP 信号灯

按灯相与黄灯队列容量将每条 item 送到三个主输出之一:绿灯行、黄灯缓冲(未满员)、红灯支路(灯相为红或黄灯队列已满)。

MOP 信号灯

AI-generated

Summary

Route each input item into one of three outputs (green, yellow, or red) based on a traffic light phase determined either by a fixed node parameter or a per-item JSON field, considering the yellow light queue capacity and current queue depth to decide red or yellow branch.

Inputs

  • 灯相来源 (required) — Selects whether the traffic light phase is a fixed node parameter or read from each item's JSON field.
  • 灯相 (required) — When a fixed parameter is used, the traffic light phase to apply for all items: green, yellow, or red.
  • 灯相字段路径 (required) — When reading phase from each item, the JSON field path to read, supporting dot notation; defaults to 'trafficPhase', and illegal or missing values are treated as green.
  • 黄灯队列容量(辆) (required) — The maximum queue size at yellow light before switching output to red branch.
  • 当前队列深度字段 (required) — The JSON field path on each item representing the current queue depth in the yellow light buffer.

Output shape

Three separate output streams corresponding to green, yellow, and red lights.

Items with green phase are output on green channel. Items with red phase or with yellow phase but queue depth at or exceeding capacity are output on red channel. Items with yellow phase and queue depth below capacity are output on yellow channel. Each output item's JSON is augmented with an added 'mopTraffic' object giving traffic phase, queue depth info, chosen branch and reason for routing.

Examples

Example 1: Input items with fixed green phase

Set phaseSource to 'parameter' and phase to 'green'. All items go to green output.

Example 2: Input items with phases per item and queue depth threshold

Set phaseSource to 'itemField', specify 'trafficPhase' for phaseField, 'queueDepth' for queueDepthField, and yellowQueueCapacity to 5. Items routed according to their individual phase and queue depth.

Links

Discussion