cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic interface determination based on file content

Former Member
0 Kudos

Dear all,

I am trying for a while to solve my issue, but wasn't able to find the answer. Maybe you could point me in the right direction whether using standard or BPM...

I've got one file with multiple entries. Dependend on a field value, I would like to call the right interface and Idoc.

Sample message:

<customers>

<customer>

<name>ABC</name>

<city>XYZ</city>

<trigger>A</trigger>

</customer>

<customer>

<name>DEF</name>

<city>QRT</city>

<trigger>A</trigger>

</customer>

<customer>

<name>GHI</name>

<city>JKL</city>

<trigger>B</trigger>

</customer>

<customer>

<name>MKN</name>

<city>TZG</city>

<trigger>A</trigger>

</customer>

...

</customers>

Dependend on the content of field "trigger" I would like to send the message to the correct interface (Idoc). I was able to trigger the interface selection in my interface determination based on a condition. So I am looking for field trigger and if = A -> Interface A is called and if = B -> interface B is called. However, it seems it is only checking for the first entry of my payload and then sending all customers to the same interface, no matter what I've got in the trigger field. What I would need is a message split and then only posting the correct rows to the selected interface.

Any ideas would be highly appreciated.

Thanks a lot,

Jens

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jens,

The content based routing is just checking the existence of a specific value. So not the first occurrence is relevant, but content based routing checks if there is <i>at least one</i> occurrence. So in your example, both interfaces (A and B) are determined. But I think that's what you are looking for.

Each Interface Determination can then call a specific mapping. So you can adapt your mapping to your specific needs.

Best regards

Joachim

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks guys!

The standard interface determination with a mapping on top and checking for the content of my trigger field combined with "remove context" on the mapping did the trick.

Jens

Former Member
0 Kudos

Hi Jens,

I can think of two options:

1) The logical expression (condition) in the Interface Determination can hold a XPath expression. In your case, it could be complex, as one single XPath has to loop at all the line times for an occurrance.

Some XPath help is available at: http://www.w3schools.com/xpath/xpath_functions.asp#sequence

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

The objective will be to remove the contexts on the trigger node to get a sequence consisting only of the trigger values, and then performing an 'index-of' function on value 'A'. If the result is a null value, then that trigger does not exist and the interface determination will not pass for 'A'. Similar condition can be used for other values of trigger.

2) Create a separate receiver system / service for each interface A, B etc. Then you can use the enhanced Receiver Determination feature in the IR itself if you are on SP16. Check this:

/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

Good luck,

Bhanu

Shabarish_Nair
Active Contributor
0 Kudos

try this - /people/suraj.sr/blog/2006/01/05/multiple-inbound-interfaces-within-a-service

But if you have multiple entries for trigger maybe you wud need to do a message split and for each message do a Xpath check and sent the data to the receiver.