Category: Workflow / Internal
This action can perform the following operations with the shared memory (details below):
From a technical perspective, the shared memory is key-value storage located in the current repository. It's the same repository that stores connectors.
The idea of shared memory is simple: it stores keys and for each key, it stores a value. Each key has one value associated with it. For instance:
Key | Value |
---|---|
Path | D:\Input files |
CustomerDB\Last reload date | 2021-09-03 |
To obtain a value, one should know the key. Keys and values can be added and removed on demand with the help of the Shared memory action. The shared memory is stored in a centralized repository. Therefore any EasyMorph workflow can read (recall) and write (remember) keys and values in the shared memory at any moment as long as it has access to the repository.
The shared memory can be convenient in many cases:
Setting | Description |
---|---|
Command | Select the operation to perform on the shared memory repository. Options: Remember, Recall, Recall a list of keys, Forget, and List. |
Description: Store a value in an associated key.
Setting | Description |
---|---|
Key* | Enter the key name associated with the value. Nested keys are permitted using backlashes to define subkeys. e.g. mykeys\key1, mykeys\key2\subkey2a. |
Pick | This button opens a window used to navigate through the current key structure. |
Value* | Enter the value associated with the key provided above. |
If key already exists | Select how EasyMorph handles situations when the provided key already exists. Options: Update value, Fail (display an error), or Do nothing (no action is taken). |
* Setting can be specified using a parameter.
Description: Retrieve the value stored in a specified key.
Setting | Description |
---|---|
Key* | Enter the key name or key\subkey "path" to the value to be retrieved. |
Pick | This button opens a window used to navigate through the current key structure. |
Column name | Choose how the column in the action's output dataset will be named. Options: Last subkey (the name of the final key), Full key name (the entire key/subkey path), or Custom* (enter a column name). |
Append column | When unchecked, the output dataset will be a single cell containing the recalled value in a column named as selected above. When checked, a new column will be appended to the incoming dataset with the recalled value appearing in each row. |
* Setting can be specified using a parameter.
Description: Retrieve the values of the shared memory keys listed within a column.
Setting | Description |
---|---|
Column name | Select the column that contains a list of fully qualified shared memory keys. |
If a key doesn't exist | Select how EasyMorph will handle cases where the listed key does not exist in shared memory. Options: Fail (the workflow stops with an error message) or Return error (the workflow continues, but an error message is returned in the "Value" column). |
Description: Clear the value and associated key from the shared memory.
Setting | Description |
---|---|
Key* | Enter the key name or key/subkey "path" to be removed. This must be a lowest-level key or an error is displayed. |
Pick | This button opens a window used to navigate through the current key structure. |
If the key doesn't exist | Select how EasyMorph handles situations when the provided key does not exist. Options: Fail (display an error), or Ignore (no action is taken). |
* Setting can be specified using a parameter.
Description: Generate a list of key-value pairs along a certain key/subkey path.
Setting | Description |
---|---|
Keys start with* | Enter a whole or portion of a key name or key/subkey "path" from which a list of key-value pairs will be generated. Entering the lowest-level key name will provide a single record with that key-value pair. Entering a higher-level key name will produce a multi-record dataset of all subkeys and values under the entered key. |
Pick | This button opens a window used to navigate through the current key structure. |
* Setting can be specified using a parameter.
For example:
Keys start with "mykeys\key1" produces a dataset with a single key-value pair:
Key | Value |
---|---|
mykeys\key1 | 12 |
Keys start with "mykeys" produces a dataset listing all subkeys with their associated values:
Key | Value |
---|---|
mykeys\key1 | 12 |
mykeys\key2 | 79 |
mykeys\key3 | 247 |
Below is a sample process for manipulating the shared memory.
Command: REMEMBER
Key: mykeys\key1
Value: 100
Command: REMEMBER
Key: mykeys\key2
Value: 200
Command: LIST
Keys start with: mykeys
Show last changed time is checked.
Key | Value | Last changed | Changed by |
---|---|---|---|
mykeys\key1 | 100 | 17-Oct-2021 | UserName |
mykeys\key2 | 200 | 17-Oct-2021 | UserName |
Command: RECALL
Key: mykeys\key1
Column name: Last subkey
key1 |
---|
100 |
Command: FORGET
Key: mykeys\key1
Key | Value | Last changed | Changed by |
---|---|---|---|
mykeys\key1 | 100 | 17-Oct-2021 | UserName |
mykeys\key2 | 200 | 17-Oct-2021 | UserName |
Current dataset:
Key_List |
---|
mykeys\key1 |
mykeys\key2 |
mykeys\key3 |
otherkeys\keyAA |
otherkeys\keyBB |
Command: RECALL A LIST OF KEYS
Column name: Key_List
Key_List | Value |
---|---|
mykeys\key1 | 100 |
mykeys\key2 | 250 |
mykeys\key3 | 700 |
otherkeys\keyAA | Mark |
otherkeys\keyBB | Mary |