Documentation
¶
Overview ¶
Package condition contains the condition node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionConfig ¶
type ConditionConfig struct {
// Property is a dotted path into the payload (same as switch rules)
Property string `json:"property"`
// Op is the comparison operator: eq | neq | gt | lt | contains | empty
Op string `json:"op"`
// Value is the comparison operand
Value string `json:"value"`
}
ConditionConfig holds configuration for the condition node — a thin two-output (true/false) variant of the switch node kept for backward compatibility with existing flows.
type ConditionNode ¶
ConditionNode routes the message to output_1 when the configured expression is true and output_2 when it is false — a single-rule switch with a dedicated false port.
func NewConditionNode ¶
func NewConditionNode(node nodestore.NodeInterface, config *ConditionConfig) *ConditionNode
NewConditionNode creates a new condition node
func (*ConditionNode) Execute ¶
func (n *ConditionNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute passes the input through unchanged — routing is done by the host via SelectPorts
func (*ConditionNode) SelectPorts ¶
func (n *ConditionNode) SelectPorts(input, output nodestore.MessageInterface) []string
SelectPorts evaluates the configured expression against the input payload: true → ["output_1"], false → ["output_2"]. Unlike the switch node a condition always routes — there is no "no match" case.