From 564c8a4f8c6ed9c1608c405d32667eb7fe34a41c Mon Sep 17 00:00:00 2001 From: Michael Maydew Date: Mon, 17 Mar 2025 11:31:40 +0100 Subject: [PATCH] IS-17702: Add trigger_on to more transforms --- hub/changelog.rst | 10 ++++++++++ .../pipes/configuration-transforms-dtl.rst | 15 +++++++++++++++ ...guration-transforms-json-schema-validation.rst | 15 +++++++++++++++ .../pipes/configuration-transforms-rest.rst | 2 +- .../pipes/configuration-transforms-xml.rst | 15 +++++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) diff --git a/hub/changelog.rst b/hub/changelog.rst index defd32b067..d693284adf 100644 --- a/hub/changelog.rst +++ b/hub/changelog.rst @@ -1,6 +1,16 @@ Changelog ========= +.. _changelog_2025-03-17: + +2025-03-17 +---------- +* Added the ``trigger_on`` property to the following transforms: + + - :ref:`DTL transform `. + - :ref:`JSON schema transform `. + - :ref:`XML transform `. + .. _changelog_2025-03-10: 2025-03-10 diff --git a/hub/documentation/service-configuration/pipes/configuration-transforms-dtl.rst b/hub/documentation/service-configuration/pipes/configuration-transforms-dtl.rst index 7bc91671bd..e68f178be2 100644 --- a/hub/documentation/service-configuration/pipes/configuration-transforms-dtl.rst +++ b/hub/documentation/service-configuration/pipes/configuration-transforms-dtl.rst @@ -32,6 +32,17 @@ Properties - ``true`` - + * - ``trigger_on`` + - Object + - A dictionary with two properties: ``"key"`` (optional, defaults to ``"_trigger"``) and ``"value"``. The ``"key"`` + should point to a property in the entity (it supports path notation) and ``"value"`` should contain a value that + this property should have to be passed into the transform. The ``"value"`` supports wildcards ("*") for substring + matching. If the ``"key"`` doesn't exist or the ``"value"`` does not match the corresponding value in the entity, + the entity will be passed through without being transformed. Note that this property is experimental and may + be changed or removed. + - + - + Example configuration ^^^^^^^^^^^^^^^^^^^^^ @@ -52,6 +63,10 @@ Transformation Language before writing them to the }, "transform": { "type": "dtl", + "trigger_on": { + "key":"_trigger", + "value": "some-value*" + }, "rules": { "default": [ ["copy", "_id"], diff --git a/hub/documentation/service-configuration/pipes/configuration-transforms-json-schema-validation.rst b/hub/documentation/service-configuration/pipes/configuration-transforms-json-schema-validation.rst index 301f86bf0c..ba0479c3d5 100644 --- a/hub/documentation/service-configuration/pipes/configuration-transforms-json-schema-validation.rst +++ b/hub/documentation/service-configuration/pipes/configuration-transforms-json-schema-validation.rst @@ -55,6 +55,17 @@ Properties - ``"errors"`` - + * - ``trigger_on`` + - Object + - A dictionary with two properties: ``"key"`` (optional, defaults to ``"_trigger"``) and ``"value"``. The ``"key"`` + should point to a property in the entity (it supports path notation) and ``"value"`` should contain a value that + this property should have to be passed into the transform. The ``"value"`` supports wildcards ("*") for substring + matching. If the ``"key"`` doesn't exist or the ``"value"`` does not match the corresponding value in the entity, + the entity will be passed through without being transformed. Note that this property is experimental and may + be changed or removed. + - + - + Example configuration ^^^^^^^^^^^^^^^^^^^^^ @@ -69,6 +80,10 @@ Example configuration }, "transform": { "type": "json_schema", + "trigger_on": { + "key":"_trigger", + "value": "some-value*" + }, "schema": { "type" : "object", "properties" : { diff --git a/hub/documentation/service-configuration/pipes/configuration-transforms-rest.rst b/hub/documentation/service-configuration/pipes/configuration-transforms-rest.rst index a4e7029ec1..64fcdcc782 100644 --- a/hub/documentation/service-configuration/pipes/configuration-transforms-rest.rst +++ b/hub/documentation/service-configuration/pipes/configuration-transforms-rest.rst @@ -154,7 +154,7 @@ Properties - - - * - ``trigger_on`` (experimental) + * - ``trigger_on`` - Object - A dictionary with two properties: ``"key"`` (optional, defaults to ``"_trigger"``) and ``"value"``. The ``"key"`` should point to a property in the entity (it supports path notation) and ``"value"`` should contain a value that diff --git a/hub/documentation/service-configuration/pipes/configuration-transforms-xml.rst b/hub/documentation/service-configuration/pipes/configuration-transforms-xml.rst index f717787667..69ef3d00c0 100644 --- a/hub/documentation/service-configuration/pipes/configuration-transforms-xml.rst +++ b/hub/documentation/service-configuration/pipes/configuration-transforms-xml.rst @@ -15,6 +15,10 @@ The properties are identical to the :ref:`XML endpoint sink ` { "type": "xml", + "trigger_on": { + "key":"_trigger", + "value": "some-value*" + }, "root-attributes": { "xmlns": "http://www.example.org/ns1", "xmlsn:foo": "http://www.example.org/ns2", @@ -64,6 +68,17 @@ Properties - true - + * - ``trigger_on`` + - Object + - A dictionary with two properties: ``"key"`` (optional, defaults to ``"_trigger"``) and ``"value"``. The ``"key"`` + should point to a property in the entity (it supports path notation) and ``"value"`` should contain a value that + this property should have to be passed into the transform. The ``"value"`` supports wildcards ("*") for substring + matching. If the ``"key"`` doesn't exist or the ``"value"`` does not match the corresponding value in the entity, + the entity will be passed through without being transformed. Note that this property is experimental and may + be changed or removed. + - + - + Example configuration ^^^^^^^^^^^^^^^^^^^^^