Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Actions is a very powerful toolbox i Perfion. You can build actions that import, export and transform data in endless ways, and you can set up actions to be executed manually by users, automated by the Perfion scheduler or triggered by various events.

Action structure

An action consists of a series of commands that are executed in sequence. Each command does the following:

  • Recieves input data from an “external” source or from any previous command

  • Transforms input data according to the command itself

  • Delivers ouput data to an “external” source or makes output data available to subsequent commands

Example:The action below generates an Excel file based on data in Perfion. It consists of three commands:

image-20240425-085752.png
  • SELECT.PERFION

    • Gets input data from Perfion (via an API query)

    • Transforms data to a generic table format

    • Makes output data available to subsequent commands

  • SELECT

    • Gets input data in generic table format from the SELECT.PERFION command

    • Selects relevant features and transforms feature captions to output specific captions

    • Makes output data available to subsequent commands

  • WRITE.EXCEL

    • Gets input data in generic table format from the SELECT command

    • Transforms data to Excel format

    • Writes data to an Excel file and saves the file to disc

Info

For further information about commands and how to build specific actions, please refer to the Action User Guide.

Access to action management in web client

In the web client, actions are managed via Actions in the main menu. Users need the role Can manage actions in web client to see the menu option:

image-20240419-101613.png

Action library

In theleft pane you see a list of existing all actions.

image-20240422-063815.png

Add new action / organize actions

If you want to add a new action to the library or reorganize existing actions, choose Manage Action from the 3-dot menu:

image-20240419-104040.png

This opens the Actions library in a grid overlay. In this grid you can add new actions and organize existing actions using normal Perfion grid operations:

image-20240419-104319.png

Edit action (metadata)

Actions have a predefined metadata structure. You can edit this metadata for all actions in the Manage Actions overlay grid shown above, or you can right-click a single action in the library and choose Open Item:

image-20240419-105135.png

This opens the action in an item editor where you can manage its metadata:

image-20240419-105403.png

Each field has a specific purpose:

Base value

Name of the action

Description

For documentation purposes. Not used by the system.

Appearance

This field controls if the action can be executed by users.

If a value is selected in the field, the action is shown in a folder with the same name in the Tools → Execute Actions menu:

image-20240419-110113.png

Apperance (ActionAppearance) is a normal selectable feature. You must create values yourself in Feature Data.

image-20240422-064114.png

Job execution

This field controls how the action is executed when users execute it manually in the windows client.

Options are:

  • Local - the windows client executes the action and waits for it to finish

  • Application server - the action is executed server side by the application server

This option has no effect in the web client. Actions are always executed by the application server.

Context feature

This field controls if the action can be executed in context of one or more features.

Info

Actions must be built with a specific struture and logic to work in context of items.

If you select Product in the field, the action can be executed by users in context of Product items:

image-20240419-111321.png

Context Features (ActionsContextFeatures) is a normal selectable feature. You must create values yourself in Feature Data.

image-20240419-111018.png
Info

Values must have identical names to the unique names of the features.

Delete action

To delete an action, simply choose Delete Action from the right-click menu. This will delete the action and all its elements.

Info

If you delete a virtual folder, all actions in the folder will be deleted.

image-20240419-111936.png

Copy action

To copy an action, simply choose Copy Action from the right-click menu. This will create an exact copy of the action with the postfix (copy) under the same parent.

image-20240419-112411.png

Export actions

Actions can be exported to an Excel file. This enables you to import actions under different names or migrate actions between environments.

  • To export individual actions, choose Export Action(s) from the right-click menu.

  • To export all actions, choose Export All Actions from the 3-dot menu.

image-20240422-064916.png

Both options will open the Export Action(s) dialogue:

image-20240422-065047.png

File name

Type in the name you want for the exported Excel file

Export with

This option controls which key to use in the Excel file

Names

Action names will be used as keys in the Excel file. This allows you to create new actions in Perfion when reimporting the file. This option is required if you want to migrate actions.

Ids

Action Ids will be used as keys in the Excel file. This only allows you to update elements of existing actions when importing the file.

The exported file looks like this. For details about the file, please refer to article Import / Export Actions.

image-20240422-071654.png

Import actions

To import actions from an Excel file, simply choose Import Actions from the 3-dot menu.

image-20240422-071958.png

This will open the Import Actions dialogue:

image-20240422-072234.png

Select the file you want to import

Click the folder icon and locate the Excel file you want to import

If one or more actions exists in advance

This option controls how the importer behaves if the import file contains actions that exist in advance.

Stop import

Importer will stop if the Excel file contains one or more existing actions.

NOTE: This option only works when Names are used as keys in the Excel file.

Skip existing actions but import new

Importer will ignore existing actions in the Excel file but import new actions.

NOTE: This option only works when Names are used as keys in the Excel file.

Replace existing actions and import new

Importer will import all actions in the Excel file. New actions will be created, and existing actions will be replaced by actions in Excel file.

Info

IMPORTANT: The importer does not “update” existing actions with changes in the Excel file. If the Excel file contains a single row with reference to an existing action, the importer will first delete the existing action and then create it with rows from Excel file.

Action elements

When you click an action in the library, you will see the structure and the elements of the action in the right pane.

image-20240422-131110.png

Groups

A group is a collection of action commands and/or other groups. Groups exist only to provide structure and overview. Groups have no technical function when actions are executed.

Add a group

Click + Group the the toolbar to add a group.

image-20240422-131938.png

The new group will be added as the last element in the action. Click the pencil icon to write a descriptive name for the group:

image-20240422-132144.png

Add a group in context

Right-click any existing element and choose Add Group to add a group in context.

  • If an existing group was right-clicked, the new group will be added as a child to the clicked group.

  • If an existing command was right-clicked, the new group will be added as a sibling to the clicked command.

image-20240422-133728.png

Organize groups

You can organize groups by dragging them by the 6-dot handle and dropping them to new positions:

  • Drop group between existing groups to reorder groups at the same level

  • Drop group inside another expanded group between existing elements to make group a subgroup (specific order)

  • Drop group on top of another collapsed group to make group a subgroup (last element in group)

image-20240422-132619.png

Copy group

Choose Copy from the right-click menu to copy a group. All elements inside the group will be copied with the group.

image-20240422-134100.png

Move group to other action

Choose Move to other Action from the right-click menu to move a group and all its elements to another action.

image-20240422-134155.png

This opens a selector where you choose the target action. The moved group will be placed as the first element in the target action.

image-20240422-134224.png

Ignore group

Click the Ignore checkbox if you want the action to ignore the group and all its elements.

Info

When a group is ignored, all elements inside the group will be ignored when the action is executed regardless of their individual “Ignore status”. The Ignore checkbox at group level takes presedence.

image-20240422-134758.png

Delete group

Choose Delete from the right-click menu to delete a group. All elements inside the group will be deleted with the group.

image-20240422-133139.png

Commands

Commands are the actual building blocks of the action. When an actions is executed, all commands are executed in the order they appear in the action.

Info

For detailed information about commands, please refer to the article Action Commands.

Add a command

Click + Command in the toolbar to add a group.

image-20240423-084900.png

This opens a new window where you select the command you need:

image-20240423-085517.png

The new command will be added as the last element in the action.

image-20240423-090246.png

Customize command

Command properties

Click the arrow button to expand the command. You can now customize the command properties found in the top section.

image-20240423-090008.png

Pencil icon

Write a short description that explains what the command does

Ignore checkbox

Check this box if you want the action to ignore the command

Settings icon

This icon opens a windows where you can choose what happens if the command fails

image-20240423-090637.png

Stop (default)

The action will stop if the command throws an error.

Proceed

The action will proceed if the command throws an error.

Execute action and proceed

Select an error handling action in the selector to be executed if the command throws an error. After the error handling action is executed, the action will proceed with next command.

Execute action and stop

Select an error handling action in the selector to be executed if the command throws an error. After the error handling action is executed, the action will stop.

Action to execute

This option is only available for commands EXECUTE.ACTION and EXECUTE.ACTION.LOOP. When one of these commands are selected, you can choose an action the command must execute:

image-20240423-092336.png

From

Name of the Input Data Source.

To

Name of the Output Data Source.

Script

Script code that may be executed by the Command. Not all commands use scripts.

Note

You can use this to supporting information and to document the command.

Customize

Command parameters

Parameters are sub-ordinates to the command. Parameters controls the specific behaviour of the command. Each command has a different set of parameters.

image-20240423-101312.png

Add parameter

Click the green + icon to add a parameter. A new row will be added where the first available parameter is selected. Change to the parameter you need.

Remove parameter

Check this red x icon to remove a parameter.

Sort parameters

Drag a parameter by the 6-dot handle to move it to a different position (relative to other parameters for the same command).

Value

The content of the Value field relates to the selected parameter.

Script

Script code that may be used by the parameter. Most parameters don’t use scripts.

Note

You can use this to supporting information and to document the parameter.

Ignore

Check this box of you want individual parameters to be ignored when the action is executed.

Customize

Command mappings

Mappings (also known as Value Mappings) are sub-ordinates to the command. With mappings you can convert input header names to output specific header names and transform values (via scripts).

image-20240423-103319.png

Add mapping

Click the green + icon to add a mapping.

Remove mapping

Check this red x icon to remove a mapping.

Sort mappings

Drag a mapping by the 6-dot handle to move it to a different position (relative to other mappings for the same command).

From

Name of Header, as it is named from Input-source.
If *** is specified this will take all columns, that are not specified by any of the other mappings.

To

Name of the Header as it should be called in the Output-source.

Script

Any Script code to execute for this header

Note

You can use this to supporting information and to document the mapping.

Ignore

Check this box of you want individual mapping to be ignored when the action is executed.

Organize commands

You can organize commands by dragging them by the 6-dot handle and dropping them to new positions. Commands can be dropped inside groups or at the same level as groups.

Info

When actions are executed, all commands are executed in their relative order. It makes no difference if they are inside a group or not.

image-20240425-092652.png

Copy command

Choose Copy from the right-click menu to copy a command. The new command is placed below the original.

image-20240425-092812.png

Move command to other action

Choose Move to other Action from the right-click menu to move a command to another action.

image-20240425-092943.png

This opens a selector where you choose the target action. The moved command will be placed as the first element in the target action.

image-20240425-093027.png

Ignore command

Click the Ignore checkbox if you want the action to ignore the command.

Info

The Ignore checkbox at command-level is disregarded if the command is inside a group and the group is ignored. In that case, the Ignore checkbox at group level takes presedence.

image-20240425-094526.png

Delete command

Choose Delete from the right-click menu to delete a command.

image-20240425-094613.png

Execute actions

As mentioned in the introduction to this article, actions can be executed in a number of different ways. These are explained below.

Execution by administrators in Actions

Actions can be executed directly via the Action icon in the toolbar. This is mostly used to test actions while they are built or updated:

image-20240425-102328.pngImage Added

Actions are executed by the application server. You can follow the progress and see if the action failed or succeded in the Job window:

image-20240425-102629.pngImage Added

Execution by users

Users can execute actions from the Tools menu in the main menu:

image-20240425-103344.pngImage Added

Two conditions must be true for users to execute actions:

  • Users must have the role Can execute actions.

  • Each action must be “approved” for user execution. This is done by assigning the action a value in the Appearance feature (please see section Edit Action (metadata) for details).

Execution by users in context of items

Actions can be executed in context of other items. This enables users to execute an action that does “something” to the selected items only (or to all items in grid):

image-20240425-104331.pngImage Added

Two conditions must be true for users to execute actions in context of items:

  • Users must have the role Can execute actions.

  • Each action must be “approved” for user execution in context of specific base features. This is done by assigning the action values in the Context feature (please see section Edit Action (metadata) for details).

Info

In order for an action to work on selected items only, the action must use a special input data source called Items. This data source contains a list of the ItemIds selected in the grid.

image-20240425-110403.pngImage Addedimage-20240425-110311.pngImage Added

Execution via Triggers

Ac action can be executed via a trigger. Please refer to the article Item Triggers for more information.

Execution via Scheduler

An Action can be scheduled to be executed at certain points in time. This is done with the Perfion Scheduler. Please refer to the article Perfion Scheduler for more information.

Execution via Perfion API

An Action can be executed by an API call. Please refer to the article Perfion Execute Action Query for more information.

Table of Contents