Skip to content

Commit

Permalink
Build the update version of the documentation (#460)
Browse files Browse the repository at this point in the history
* update and fixing documentation

* improve mapping examples

* add context to launch documentation
  • Loading branch information
gsambrotta authored Apr 3, 2024
1 parent 26d0655 commit 7845b91
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 23 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ Kendraio App
.. toctree::
:maxdepth: 2
:caption: Automated testing

testing/tips
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx-prompt
docutils<0.18
sphinx_rtd_theme
18 changes: 17 additions & 1 deletion docs/workflow/blocks/launch_block.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ Supported properties
--------------------

- **adapter** - The adapter of the flow to launch
- **workflowId** - The workflow to launch
- **workflowId** - The flow to launch
- **valueGetters** - An onbject containing JMESPath to evaluate for adapter and workflowId.
- **context** - Data that will be passed to the flow to launch

Dynamic config
--------------

.. code-block:: json
{
Expand All @@ -33,6 +35,20 @@ Dynamic config
}
}
With context
------------

.. code-block:: json
{
"type": "launch",
"adapter": "schemas",
"workflowId": "edit",
"context": {
"id": "data.uuid"
}
}
50 changes: 28 additions & 22 deletions docs/workflow/blocks/mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,19 @@ Handy JMESPath patterns
-----------------------

Using a string as a value
^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------


To be valid JMESPath, keys and values must be wrapped in double quotes.
For a hardcoded string, the value must be wrapped in backticks, otherwise it will result `null` for undefined variables.
A hardcoded string's value must be wrapped in backticks, otherwise it will result in `null` for undefined variables.

.. code-block:: json
{
"name": `John`,
"surname": `Doe`,
"iAmNull": "not showing"
}
{
"name": `John`,
"surname": `Doe`,
"iAmNull": "not showing"
}
Output will be:

Expand All @@ -72,19 +76,19 @@ Output will be:
surname: "Doe"
iAmNull: null
We've seen that property values of object keys can be set using backticks, and it is also possible to wrap a whole JSON object in backticks.
The output will be the same as this:
It is also possible to wrap a whole JSON object in backticks:

.. code-block:: json
`{
"name": "John",
"surname": "Doe",
"iAmNotNull": "now this value is visible too"
}`
`{
"name": "John",
"surname": "Doe",
"iAmNotNull": "now this value is visible too"
}`
Not
^^^
---
When your data structuture holds the value that you wish to negate, you need to enclose the
path of your data in parentheses before you NOT it.

Expand All @@ -110,15 +114,17 @@ If you want to combine a NOT statement like this with additional logic, you need
Default values
^^^^^^^^^^^^^^^
--------------

Set default values by using "||" (or)

- value || '[default]'
.. code-block:: text
data || {}
Filtering data
^^^^^^^^^^^^^^
--------------

Filter by the existence of a flag

Expand Down Expand Up @@ -216,7 +222,7 @@ And this version will return an array of objects
Merging two arrays
^^^^^^^^^^^^^^^^^^^
------------------

If you have two arrays, and want to combine them, you can use the flatten operator "[]".
For example, if you want to combine information from a form with data you've previously saved to context, you can merge the two arrays like this.
Expand All @@ -227,7 +233,7 @@ For example, if you want to combine information from a form with data you've pre
Creating an object from two arrays - spreadsheet import
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------------------------------------
To import from a spreadsheet, converting each row into an object with keys in the first row,
you need a combination of actions.

Expand All @@ -247,7 +253,7 @@ you need a combination of actions.


Kendraio Mapping extensions
----------------------------
---------------------------

Kendraio is using a version of JMESPath that supports extensions to provide additional functionality. You can find these in our repository:

Expand All @@ -266,7 +272,7 @@ These extensions are a set of additional functions that complement the standard
}
Available Extensions
---------------------
--------------------

1. get
2. set
Expand Down

0 comments on commit 7845b91

Please sign in to comment.