cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Interface Determination with Flat Files

Former Member
0 Kudos

Hello,

I have one sender interface (dummy) which could either hold a flat file or an XML file. On receiver side there is one system with two receiver interfaces, one should be used for the XML structure and one for the flat structure.

My requirement is to have a conditional interface determination with an (exclusive) OR logic. Pseudo code:

The XML structure has "submission" as root node. So I use the condition (/submissioin) EX to determine whether it is an XML file and I check with not(/submission) EX to determine whether it is a flat file. However the condition does not work using a flat file ("Unable to find an inbound interface"). Could it be, that the conditional expression never is true in case a flat file arrives? How can I achieve this requirement?

What I additionally do with the flat file is just calling a Java Mapping that sets dynamic attributes for a file receiver, the flatfile itself is dumped on a file system without any addtional conversion logic.

Thank you for your advice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Florian,

After going through your post I found that you are trying in Conditional Recevier detrmination as in Interface determination you cant have conditional interface determination with an (exclusive) OR logic.

Secondly if on sender side you have dummy interface then you can't call the XPTh in conditional recevier detrmination for that you must have a real sender interface refrencing a real message type ( However not sure expert can give there opinion ).

If possible try to elaborate your requirement so that expert can help you.

Regards,

saurabh

Former Member
0 Kudos

After going through your post I found that you are trying in Conditional Recevier detrmination as in Interface determination you cant have conditional interface determination with an (exclusive) OR logic.

I would like to "simulate" that exclusive or just by setting the conditions appropriately.

If /submission exists then take interface A, if /submission does not exist (because it is a flat file) then take interface B

Secondly if on sender side you have dummy interface then you can't call the XPTh in conditional recevier detrmination for that you must have a real sender interface refrencing a real message type ( However not sure expert can give there opinion ).

Actually I am referencing to a message type which refers to the XML structure. So if a XML file arrives it has the structure of the message type, but not if a flat file arrives.

Former Member
0 Kudos

Hi ,

I hope its possible !!!

In Interface Determination , if you are using the Condition its possible to have Exclusive OR .

Check it

Regards,

Jude

Former Member
0 Kudos

I will try to elaborate my requirement a little bit more:

Our partner is sending 3 different messages that we receive using the same AS2 Sender Adapter. There are no separate subjects so using a dummy sender interface seems to be the only way to go for me.

The three different messages should be processed like this:

A:) XML File with root node submission: Route to receiver interface A and apply mapping

B:) Flat FIle: Route to receiver interface B

C:) XML File with root node html: Ignore that file, no need to process.

What would be best practice to handle this? (Receiver system for A and B is the same).

Former Member
0 Kudos

Hi Florian,

Have you tried using condition editor in Receiver Determination? If an item fails your condition for "submission" you can force an "end without error" or send on to an alternate Receiver Service.

Former Member
0 Kudos

Yes, I am aware of the functionality to end a process in case a receiver has not been found. However I have some concerns:

1. I do not use multiple receivers, so I would prefer to add the condition checks in an interface determination instead of a receiver determination

2. I still need to check for a flat file as there is a defined receiver interface for the flatfile. (So there should be a check, whether the root nodes for an XML file do not exist, however I have the feeling that conditions on a flat file do not work at all, that is the currently the main problem).

An alternative approach would be to check for the root nodes of the XML. So if one root node exists then stop processing, and if none of them exists then route to receiver for flat file.

However I can I stop processing in case a node exists?

Former Member
0 Kudos

Yes, that is what I was thinking (in the alternative approach).

You most likely cannot do conditions on the flat file because it hasn't been parsed into data fields by the adapter. If you have no way to distinguish message contents at Adapter level then it will only parse one way or the other.

Perhaps if you were able to sort the files at adapter level by going into different folders or by naming convention then you would have better luck.

Former Member
0 Kudos

Hello,

yes, I think I will go for the approach that I will determine different receivers in the receiver determination and route the flat file to a specific receiver in case no condition applies.

However there is still a minor problem:

How can I ingnore a message in case a condition applies? I am just aware of the fact that you can ignore messages in case NO condition applies.

What is best practice in this case? Should I use a "dummy receiver"? However if I use a dummy receiver I think I would receive a "interface determination not found" error. How would you do that?

Former Member
0 Kudos

How can I ingnore a message in case a condition applies? I am just aware of the fact that you can ignore messages in case NO condition applies.

Couldn't you simply reverse the logic and use "not equals"? Or perhaps you can use the EX operator to alter your conditions... here is more info on the EX (exists) operator

What is best practice in this case? Should I use a "dummy receiver"? However if I use a dummy receiver I think I would receive a "interface determination not found" error. How would you do that?

I've never found the need to work with dummy receivers so I cannot comment there.

Former Member
0 Kudos

Hello,

thank you again for your input. However I use a different approach now, as I check for dynamic attributes for routing purposes rather than checking the payload itself.

Answers (0)