cancel
Showing results for 
Search instead for 
Did you mean: 

AS2 Adapter - Sender Communication Channel - Dynamic File Name and File Path

tharaka_fernando
Contributor
0 Kudos

Dear All,

Can you please explain how to configure AS2 - Sender channel for below requirements.

PI Version : 7.4

We have several interfaces that is going to communicate through AS2 with business clients.

How to segregate the PI interface with file name that partner is sending to us. because i don't see a place to put File name parameters in 7.4 - AS2 sender communication channel like we do for File Adapter in PI.

Ex : Partner - "ABC Ltd" is sending several files(XML , EDI) through AS2 to PI system. - ex : Purchase Order , Goods Receipt , Delivery ...files

  • So How do we identify which file should pick for Purchase Order Interface and the others file for Goods Receipt.

          Do we have to create separate communication channels for each & every Interface ?  or can we use one common Communication channel for all           the Interfaces ? Please explain

  • How to configure the AS2 file that has dynamic file name .

          ex: Purchase Order file name : "PurchOrder+Date Created + Time Created + .xml" .Then how to set this parameter in AS2 sender comm. channel

  •   Can we define a file path location for each and every PI Interface.

          guess it has to be done in AS2 sender communication channel - expected URL path parameter. soemthing like "http:://<local:port>/AS2/<path>"

your valuable ideas are highly appreciated..

Thank you all in advance...

Accepted Solutions (0)

Answers (1)

Answers (1)

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

You can use the following check box on your AS2 sender channel so the system will record a number of attributes about the incoming message:

When that checkbox is selected the system will record all of the valid dynamic attributes that you can use and then you can read them using the normal dynamic configuration API with the namespace "http://sap.com/xi/XI/AS2/AS2" and the proper attribute name.




Regards,

Ryan Crosby

tharaka_fernando
Contributor
0 Kudos

Hi Ryan,

Thank you for the reply..

Can you please explain more.

If I set "Set Dynamic Parameter" option ticked in Sender Communication Channel but how/where to set dynamic file name values ?

Please explain..

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

If you want to set the values then you can either use the DynamicConfiguraitonBean or you would need to insert the values using the Dynamic Configuration API within a java or graphical mapping.

Regards,

Ryan Crosby

tharaka_fernando
Contributor
0 Kudos

Hi Ryan,

Thank you.

Guess what you meant was I can use a UDF as well.If I write a simple java code (UDF) for file name identification , will it automatically identify the file at run-time?

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

Here is a sample of something you might try:

Valid values for the properties you can read are: AS2Filename, AS2FromEmail, AS2MessageIdRight, AS2MessageIdLeft, AS2To, AS2URL, AS2ContentType, AS2ReceiptDeliveryOption, AS2MessageId & AS2From.

Regards,

Ryan Crosby

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

One thing I forgot to mention too is that all of these properties could be used for interface splits and receiver determination just like the file stuff as well.

Regards,

Ryan Crosby

tharaka_fernando
Contributor
0 Kudos

Hi Ryan,

Thank you for the reply...I am already using this option "file name" for AS2 receiver communication channel and its working fine.

I went through your UDF code and many thanks for sending that.

but my concern is when I am using this code for Sender Communication channel, say if this logic is true (as per above "propertykey.startsWith("PO")  == true) then AS2 Sender Communication channel should pick the file and process.

if false , then file should be ignored..

how to do that (pass a values to pick and process the file) ?

Thanks

'

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

If you don't want to process those files at all then you would need to work on a multiple receiver split where you can designate those payloads to go to some other location.  You can use the XPath with the context objects to work out this logic and then dump any files that shouldn't be processed into some dummy location or something like that.

Regards,

Ryan Crosby