Skip to Content

Recently came across a pass-through File-to-File scenario to create target FileName as <SenderFileName>_<DateTime>.<extension>

<SenderFileName> – File name picked by sender channel

<DateTime> – Date time in particular format for e.g. “ddMMyyyy”

<extension> – Constant file extension for e.g. .pgp

If we use Graphical/Java mapping this can be easily achieved by DynamicConfiguration class.

However required scenario was pass-through, we didn’t wanted to end up using mapping just for changing filename.

There are workarounds available using DynamicConfigurationBean where-in attributes of the message header can be set in message header parameters and then can be accessed by Variable substitution .

These header attributes can be set by module: sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,message_id,message_id_hex. These can be read during variable substitution.

However the approach is not advisable as we are replacing default message headers which may incur potential issues.

Then we came across AttribMapper adapter module.

It comes as part of Seeburger Suite, which is available in our landscape, it solved our case.

This scenario is achieved by using it in File Receiver channel:


AttribMapperReceiverChannel.PNG


To set ASMA paramter it has to be used in module parameter as:

<namespace>/<param>

fo e.g. http://sap.com/xi/XI/System/File/FileName


ASMA paramter value can be read as:

@<namespace>/<param>

for e.g. @http://sap.com/xi/XI/System/File/FileName



Though Attribmapper comes as part of thid-party add-on, it is perfectly capable of reading and writing all ASMA parameters.

This prompted me to explore more of Attribmapper, not much content is available in SCN.

Below are some of the useful functions which are available with this module:


getDateTime(“ddMMyyy”)

Output: DateTime in Desired format. Provide required format within “”

getCurrentTimeInMillis()

Output: java.lang.System.currentTimeMillis()

getMessageId()

Output: Message ID for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331

getRefToMessageId()

Output: Reference ID for the synchronous response

getConversationId()

Output: Reference ID for processing using queues

getCorrelationId()

Output: Reference ID for the asynchronous response

getAction()

Output: Interface Action

getDeliverySemantics()

Output: EO/EOIO/BE

getFromParty()

Output: Sender Party value. If not set then “null”

getFromService()

Output: Sender Service . If not set then “null”

getMessageDirection()

Output: INBOUND/OUTBOUND

getToParty()

Output: Receiver Party value. If not set then “null”

getToService()

Output: Receiver Service . If not set then “null”

Output of these functions can be appended with operator “&” and set it to desired ASMA parameters

for e.g such a configuration is possible:


AttribMapperReceiverChannelExample.PNG


Please share your thoughts on this.



Reference: AttribMapper – Assign AS2 Filename Dynamically by Prateek Srivastava

To report this post you need to login first.

5 Comments

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

Leave a Reply