Working with the Datastore of a Workflow
1. What You Will Learn
In this guide you will learn how to create a datastore and use it to configure your workflow.
This guide will build upon this guide. |
2. Prerequisites
To complete this guide you will need:
-
Roughly 10 minutes
-
The PAK Editor (Download here)
3. What Is the Datastore
The Datastore can be seen as the Workflows main data storage component. At runtime, it is filled with all values that are created during Workflow execution. We can use these values as parameters for the Commands within.
4. When to Use the Datastore
In the PAK Editor, the Datastore acts as a global storage for constant values.
You should use the Datastore when…
-
you have a constant value which does not change and is consumed by multiple commands.
-
you want to use the same workflow with a different parameterization .
5. How to Use the Datastore
Values of the Datastore can either be added via the PAK Editor or by manually editing the resulting .json file.
5.1. Editing the Datastore in the PAK Editor
After we opened a new workflow in the editor, we will see a Datastore tab right next to Dataflow Analysis. Once clicking on it, we have the option to add a new entry by clicking on the „+“-button (2). We can now give our entry a name, for example „Testkey“ (3). Our value will be „Testvalue“ (4). After that click on Save (5) on the bottom of the tab.
Do not forget to also save the Workflow after editing your Datastore |
Whenever we save a Workflow whose Datastore is not empty, a new .json file with the same name as the Workflow will be created in the same directory |
5.2. Manually Editing the Datastore
Let’s have a look into the .json file. It is located in the same directory as the Workflow. Navigate to said directory and open the .json file with a text editor of your choosing. You should now see the following JSON.
[
{
"key": "Testkey",
"value": "Testvalue"
}
]
When we for example change the value of Testkey to „Hello World“, we simply edit our file to include
[
{
"key": "Testkey",
"value": "Hello World"
}
]
After saving the File and switching back to the PAK Editor, we have to reload the changes. In order to do that, we click on the Load button and select our .json file. Now we can see the changes in the datastore tab.
In order to use the Datastore in your workflows, please refer to the basic- and advanced mapping guides |