Skip to Content

Hi Folks,

Today I have used this feature ,variable substitution ,in receiver file adapter. Although many of you might have already used it but I
have used this for the first time and found it very useful. So here are few of my  closely knit thoughts on this feature
which may help someone who is not aware of this.

Basically variable substitution can be used by selecting enable the variable substitution checkmark in receiver file adapter communication
channel.

The variable substitution is helpful in cases where your requirement is like If you want to specify variables in the target directory
and file name scheme, they must be enclosed by % characters.

To use variable substitution, enable as shown in the screenshot.

Untitled.jpg

Provide the file name scheme as Customer_ %Var1%.xml where in Var1 is dynamic value taken from the message.

  /wp-content/uploads/2013/04/x_206112.jpg


Make entries under Variable Name and Reference in the table

The variables can refer to attributes of the message header or elements of the message payload

For referring  elements of the message payload:

/wp-content/uploads/2013/04/2_206108.png
Where firstrootnode is first rootnode, numerical 1 indicate it is rootnode1, secondrootnode is the secondroot node belonging to the main node or first node.

The parser searches for the first occurrence of the root element at the first level.

It then searches for the first occurrence of the node at the second level and for the second occurrence of node at the third level.

If the variable refers to an attribute of the message header, add the prefix message: to the name
of the variable under Reference

You can specify the following attributes of the message header:

sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace.

These are standard attributes. To refer party, service, interface, you have to use as above.

For ex: if you want to access
party in the receiver file name, then you define some variable and then ask
that variable to refer to sender_party for sender.

For var1 , you have to write as

/wp-content/uploads/2013/04/3_206110.png

To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.

/wp-content/uploads/2013/04/4_206111.png

Otherwise, the adapter checks whether the element data contains characters that could lead to security risks
in the file system environment. The check includes the characters “/“, “\“, and “..“.

Hope this provides some information about variable substitution in receiver file adapter.

Thanks,

Regards,

Amarnath

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Aman Gupta

    Hi Amar,

    Nice explanation. Is Variable substitution also works on source structure? or we have to go for ASMA option only, if the requirement is to get value from Source structure.

    Thanks,

    Aman

    (0) 

Leave a Reply