From 797608cf7276b1aa8c8423df44129093a697e74a Mon Sep 17 00:00:00 2001 From: Sanoj Punchihewa Date: Tue, 10 Dec 2024 13:40:35 +0530 Subject: [PATCH 1/2] Add variable mediator docs --- .../reference/mediators/variable-mediator.md | 88 +++++++++++++++++++ en/mkdocs.yml | 1 + 2 files changed, 89 insertions(+) create mode 100644 en/docs/reference/mediators/variable-mediator.md diff --git a/en/docs/reference/mediators/variable-mediator.md b/en/docs/reference/mediators/variable-mediator.md new file mode 100644 index 000000000..e5222c768 --- /dev/null +++ b/en/docs/reference/mediators/variable-mediator.md @@ -0,0 +1,88 @@ +# Variable mediator + +The Variable mediator is used to manage variables within a mediation flow. The Variable Mediator allows you to set or remove variables, which can then be used later in the mediation flow. + +## Syntax + +```xml + +``` + +## Configuration + +The parameters available to configure the Variable mediator are as follows: + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter NameDescription
Action

The action to perform on the variable.

+
    +
  • set: If this is selected, the variable will be set in the message.
  • +
  • remove: If this is selected, the variable will be removed from the message.
  • +
Name
+

The name of the variable. This name uniquely identifies the variable in the mediation flow.

+
Data Type
+

The data type of the variable. Available types are as follows:

+
    +
  • STRING
  • +
  • INTEGER
  • +
  • BOOLEAN
  • +
  • DOUBLE
  • +
  • FLOAT
  • +
  • LONG
  • +
  • SHORT
  • +
  • OM

  • +
  • JSON

  • +
+
ValueYou can give either a static value or a Synapse expression. +
+ +## Examples + +### Set a Variable with a Literal Value + +This example demonstrates setting a variable with a static value. + +```xml + +``` + +### Set a Variable with an Expression + +This example demonstrates dynamically setting a variable using an expression. + +```xml + + +``` + +### Remove a Variable + +This example demonstrates removing a variable from the message. + +```xml + +``` diff --git a/en/mkdocs.yml b/en/mkdocs.yml index 4be091d0a..2ddba4e26 100644 --- a/en/mkdocs.yml +++ b/en/mkdocs.yml @@ -861,6 +861,7 @@ nav: - Transaction Mediator: reference/mediators/transaction-mediator.md - URLRewrite Mediator: reference/mediators/urlrewrite-mediator.md - Validate Mediator: reference/mediators/validate-mediator.md + - Variable Mediator: reference/mediators/variable-mediator.md - XQuery Mediator: reference/mediators/xquery-mediator.md - XSLT Mediator: reference/mediators/xslt-mediator.md - Property Catalog: From aa3139efc3af30f195ec83ac232d8751f8a634bf Mon Sep 17 00:00:00 2001 From: Sanoj Punchihewa Date: Thu, 12 Dec 2024 08:48:36 +0530 Subject: [PATCH 2/2] Fix review comments --- en/docs/reference/mediators/about-mediators.md | 8 +++++++- en/docs/reference/mediators/variable-mediator.md | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/en/docs/reference/mediators/about-mediators.md b/en/docs/reference/mediators/about-mediators.md index 444a11df1..b17d10633 100644 --- a/en/docs/reference/mediators/about-mediators.md +++ b/en/docs/reference/mediators/about-mediators.md @@ -48,12 +48,18 @@ WSO2 Micro Integrator includes a comprehensive catalog of mediators that provide Content aware/unaware - Generic mediators + Generic mediators Call mediator Conditionally content-aware + + + Variable mediator + + Conditionally content-aware + Property mediator diff --git a/en/docs/reference/mediators/variable-mediator.md b/en/docs/reference/mediators/variable-mediator.md index e5222c768..e0dec8069 100644 --- a/en/docs/reference/mediators/variable-mediator.md +++ b/en/docs/reference/mediators/variable-mediator.md @@ -1,6 +1,6 @@ # Variable mediator -The Variable mediator is used to manage variables within a mediation flow. The Variable Mediator allows you to set or remove variables, which can then be used later in the mediation flow. +The Variable mediator is used to manage variables within a mediation flow. The Variable mediator allows you to set or remove variables, which can then be used later in the mediation flow. ## Syntax @@ -62,7 +62,7 @@ The parameters available to configure the Variable mediator are as follows: ## Examples -### Set a Variable with a Literal Value +### Set a variable with a static value This example demonstrates setting a variable with a static value. @@ -70,7 +70,7 @@ This example demonstrates setting a variable with a static value. ``` -### Set a Variable with an Expression +### Set a variable with an expression This example demonstrates dynamically setting a variable using an expression. @@ -79,7 +79,7 @@ This example demonstrates dynamically setting a variable using an expression. ``` -### Remove a Variable +### Remove a variable This example demonstrates removing a variable from the message.