Import / Export Actions
Import
In this section we will go into details how to specify import data and import actions.
Data Format
The import data is table like data and can be specified as import data headers and import data values. The import data closely resembles Actions data setup in Perfion. The example is shown in Figure 1.
Action import data format is shown in the table below.
Data header | Mandatory | Description |
Action Action_ID | Yes | Actions feature item value or ID. This item will be referred to as “Action item”. String value, which represents the full hierarchical path to Action item. The path must be specified using rules as described in “Base Values of Action and From Items”. It is a mandatory parameter. The data header name must be defined as “Action” if Action item is defined using values, and as “Action_ID” when Action items are defined using Perfion IDs. Action items will be used to match existing data in Perfion during actions import. From Perfion 2021 R2 SR1: If some nodes are missing in the specified path, the importer will create the missing nodes as Virtual nodes. Notes:
|
From | Yes | ActionMapFrom feature item value. This item will be referred to as “From item”. String value, which represents the full hierarchical path to From item. The path must be specified using rules as described in “Base Values of Action and From Items”. Notes:
|
To | No | ActionMapTo feature value. Parameter is optional. String value. |
Command | No | ActionMapCommand feature value. Parameter is optional. If a command is defined in import data, then it has to be one of existing action commands predefined in Perfion. Values are case insensitive. |
RefAction | No | ActionMapAction feature value. Parameter is optional. RefAction parameter is directly related to Action/Action_ID parameter and inherits its type. When Action items are defined using paths and Action data header, then RefAction values must also be defined using paths. When Action items are defined using IDs and Action_ID data header, then RefAction values must also be defined using IDs. Notes:
|
Script | No | ActionMapScript feature value. Parameter is optional. Text value. |
Note | No | ActionMapNote feature value. Parameter is optional. Text value. |
Some other details about import data:
Data header names are case insensitive.
Data header order in import data is not important.
One can comment the data header in import data by using # prefix. For example, data header “#Note” will be ignored by importer.
NOTE: Default values are not supported by Actions import.
Base Values of Action and From Items
Action and From items are hierarchical and if defined using base values, they have to be defined using the full path starting from the root hierarchy node to the actual base value. In addition, RefAction item has the same format as Action item and the same rules are valid also for this parameter. The exception is only when Action and RefAction items are defined using IDs.
Item type | Item value | Example |
Normal | Full path to actual item starting with a root item | RootItem|Node2Item|ActualItem |
Virtual | Full path to actual item starting with a root item with prefixed virtual item indicator | ^RootItem|Node2Item|ActualItem |
Catalog | The Catalog type items are not supported and have to be converted to virtual items. | - |
Virtual indicator is the caret (^) character and to separate the nodes in the path the pipe (|) character is used.
Example
The Figure 2 shows an example Action setup with catalog, virtual and normal items and then the table below shows how to build paths for Action, From and RefAction items for this particular setup.
Item | Item type | Full path | Description |
Action items | |||
CatalogItem | Catalog | ^CatalogItem | Catalog is treated as if it is a virtual item. |
VirtualItem | Virtual | ^CatalogItem|VirtualItem | The path references virtual item, therefore there is a virtual indicator as prefix to the path. |
NormalItem | Normal | CatalogItem|VirtualItem|NormalItem | Normal item does not have a prefix. |
VirtualItem2 | Virtual | ^VirtualItem2 |
|
NormalItem2 | Normal | VirtualItem2|NormalItem2 |
|
From items | |||
VirtualFromItem1 | Virtual | ^VirtaulFromItem1 | From item paths follow the same rules as action items. |
NormalFromItem1 | Normal | VirtaulFromItem1|NormalFromItem1 | |
VirtualFromItem2 | Virtual | ^VirtaulFromItem2 | |
NormalFromItem2 | Normal | VirtaulFromItem2|NormalFromItem2 | |
RefAction items | |||
NormalItem2 | Normal | VirtualItem2|NormalItem2 | RefAction refers to actual Action items and have the same paths. |
VirtualItem2 | Virtual | ^VirtualItem2 |
Node Escaping
Item base value may have any characters if it is a String or Text type feature. In order to be able to distinguish between separate path nodes, the node’s value must not include the character used as a path separator or the path node must be escaped. One can use 4 delimiters (‘, “, $, #) for escaping.
The rules for path node escaping:
# | Rule | Example | Comment |
1 | The node value must be escaped if it contains a path separator (|) or one of 4 delimiter (‘, “, $, #) characters. Note: The node value must be escaped even if it is a single node in the path. | abc
| No escaping needed, because node value does not have separator or delimiter characters. |
Value vs. escaped value:
| Example of node values which has to be escaped, because they include either separator or delimiter character. | ||
2 | Escaping can be done using any of 4 delimiters which is not used in the node’s value. Note: The delimiter use order is not important. | Value vs. escaped value:
|
|
3 | Node value may not have all 4 delimiter (‘, “, $, #) characters. | a’b”c$d#e | Illegal node value, which cannot be escaped, because it has all delimiter characters. |
4 | Node value escaping is independent for each node in the path. Note: Different delimiters can be used for different path nodes. | Value vs. escaped value:
| Node 1 and Node 4 do not need escaping. Node 2 and Node 3 must be escaped. Note, that Node 2 and Node 3 are escaped using different delimiters. |
5 | Node value can be escaped even if it does not have to be escaped. | Value: abc Valid escaped values:
| Escaping can be used even if there is no need for it. |
6 | Empty paths must be escaped, but only if they belong to From or RefAction items. < |