Add process plugin gate_comparator

Created on 17 December 2023, about 1 year ago

Problem/Motivation

It would be nice to have a process plugin that can compare two values (or their tokens) and either pass through the source if the gate passes, or change the value to a default.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States swirt Florida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @swirt
  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida
    • swirt β†’ committed fe90c883 on 8.x-2.x
      Issue #3409322 by swirt: Add process plugin gate_comparator
      
  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida

    This has been created and will go out with the next release.

    /**
     * Compares two values, and if the comparison is true, passes the source thru.
     *
     * @MigrateProcessPlugin(
     * id = "gate_comparator",
     * handle_multiples = TRUE
     * )
     *
     * Example usage: Compare value A to value B. If TRUE use the process pipeline
     * source.  If FALSE, use the 'when_false_value'.
     * @code
     * field_some_text_field:
     *   plugin: gate_comparator
     *   value_a: a string or number to compare or 'source' to use the source.
     *   comparison: = comparison to evaluate [=, <, >, !=, <=, >=]
     *   value_b: the other string or number to compare
     *   when_false_value: A value to use if the comparison is FALSE
     *   source:  The source value to use if the comparison is TRUE
     *
     * @endcode
     *
     * Example usage: Choosing the bigger value between two source fields.
     *
     * @code
     *  field_some_text_field:
     *   plugin: gate_comparator
     *   value_a: cost
     *   comparison: '>'
     *   value_b: average_cost
     *   when_false_value: average_cost
     *   source: cost
     *
     * @endcode
     */
    
    
  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida

    Released with 8.x-2.8

Production build 0.71.5 2024