KB Article #181501

ADVANCED ROUTING: Set Flow Attributes in a Custom AR Step

Overview

The Set Flow Attributes Advanced Routing (AR) step enables creation and/or modification of file flow attributes during file transformation and routing in SecureTransport Advanced Routing. It can be used in any place of the Advanced Routing process chain.


For more information on Flow Attributes, please refer to the Flow and subscription attributes section in the ST Administrators Guide.


Prerequisites

SecureTransport 5.5-20201029 or higher.


Download

The custom Set Flow Attributes AR Step's installation package can be downloaded from the AMPLIFY Repository.


Installation

To install the Set Flow Attributes AR step, perform the following steps on all SecureTransport Server nodes:


Delete the following files/folders associated with the previous version of this step (if they exist):


  • <FILEDRIVEHOME>/plugins/routingSteps/axway-step-setflowattributes.jar
  • <FILEDRIVEHOME>/plugins/routingSteps/axway-step-setflowattributes


The existing Custom Step configurations in ST will be preserved.


Extract the securetransport-plugins-step-setflowattributes-<plugin_version>.zip into <FILEDRIVEHOME>/plugins/routingSteps


Restart all SecureTransport services


Configuration

To configure a Set Flow Attributes AR step:


Navigate to the Admin UI → User Accounts → <account> → Routes page.


Click the New Route button.


Select Set Flow Attributes from the Select Step list.


The following configuration settings are displayed:



Flow Attributes configuration settings



Flow Attribute Metadata - required field

The specified key=value pairs metadata will be stored in ST file flow attributes of the transformed file. Each metadata mapping must be on a separate line. The key=value pairs will be evaluated using ST expression language where the available Advanced Routing, flow attributes, LDAP and environment variables can be accessed via the plugin. prefix, e.g.:


Environment variables ${plugin.env['DXAGENT_HOMEDIR']}, ${plugin.env['DXAGENT_USERUID']}, ...
Transfer variables ${plugin.transfer.target}, ${plugin.transfer.coreId}, ...
LDAP variables ${plugin.ldap.domainName}, ${plugin.ldap.dn}, ...
Flow attributes ${plugin.flow.attributes['Test']}, ${plugin.flow.attributes['userVars.test']}, ...



Actions

When you add the step to your Advanced Routing Application, you can select from 4 different options what should happen with the defined attributes:


Add new - this option will add the attribute only if it does not exist in the context.

Add new or overwrite existing - this option will add the attribute to the context no matter if it exists or not.

Overwrite - this option will add the attribute only if it already exists in the context.

Delete - this option will delete the specified attributes.


Use case

Navigate to the Admin UI → User Accounts → <account> → Routes page.


Click the New Route button.


Select Set Flow Attributes from the Select Step list.


Add the metadata key=value pairs in Flow Attribute Metadata field, e.g. test=test1234.


Select an action, e.g. Add new or Overwrite existing.



Flow Attributes configuation example


Add a Rename Step to the Route.


To use the flow attribute setup in the previous step enter the following expression in the Output File Names field: ${flow.attributes['test']}.



New file name using the Flow Attributes configuration in the previous Step


Add a Publish To Account Step and configure it as usual. You can publish to the same account as well.


Save the Route package.


Assign the Route to a Subscription.


Login to ST with the user and upload a test file, e.g TestFile.txt to the AR subscription folder.


The file is sent to the account from the Publish Step, via PTA, with a new name test1234.



File Tracking records


Troubleshooting and Notes

To enable extended debug logging, edit the <FILEDRIVEHOME>/conf/tm-log4j.xml config file. Find the com.axway.st.plugins.routing logger element and set its level value to DEBUG.


To access the file's flow attribute set by the Set Flow Attributes Step use the expression - ${flow.attributes['metadata_key']}, where the metadata_key is the key from key=value pair in the Step configuration. If you want to use the userVars. prefix it should be added as a prefix to the key, e.g userVars.test and the expression would be ${flow.attributes['userVars.test']}.


The Set Flow Attributes Step can be configured using the /routes ST Admin REST API endpoint. The REST API definition of the Set Flow Attributes Step is available in Swagger YAML file format under <FILEDRIVEHOME>/plugins/routingSteps/axway-step-setflowattributes.