Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

Variable Substitution for Directory or File name.

$
0
0

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.

 

  x.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:

2.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

3.png

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

4.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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>