cancel
Showing results for 
Search instead for 
Did you mean: 

XPath Condition - Dynamic determination

Former Member
0 Kudos

Hi,

I am doing one scenario where I need to determine interface dynamically. So in interface determination I am configured two inbound interfaces with some condition. For that I am using XPath condition.

Following is my source data structure.

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_test xmlns:ns0="urn:aa-bb:test">

<Input>

<Input>

<Input1><b>Mr.</b> FirstName LastName</Input1>

</Input>

</Input>

</ns0:MT_test>

<b>Condition:</b>

/p1:MT_QueryDamageIntentClaim1/Input/Input/[substring(Input1,1,3) = 'Mr.']

If I use simple condition (= and not EX) then this is working fine. But here I need to compare first 3 characters from <input1> and so I can not use simple condition.

For this I already referred following blogs and URL but it is not working.

<a href="/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination:///people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

<a href="/people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object:///people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object

Regards,

Sunil Bhavsar.

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

Sunil,

is your message type MT_test or MT_QueryDamageIntentClaim1 ?

Regards,

Henrique.

Former Member
0 Kudos

Hi

I'm facing a similar kind of problem.I need to dynamically determine the namespace in interface determination.

In my condition i gave /MT_Prdoct/Record/ID= 01.I need to dynamically determine the namespace coming from outbound message interface MI_Product_OB.how do i do that?

Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

for exampel my condition looks like that:

Left Operand

(/MBGMCR01/IDOC/E1BP2017_GM_HEAD_01[substring(BILL_OF_LADING,1,4) != "0411"] EX )

Operand = EX

Right Operand

leave empty

Former Member
0 Kudos

Hi Gordon,

Thanks for reply

I have tried with following but still not it is not working...

/p1:MT_QueryDamageIntentClaim1/Input/Input/[substring(Input1,1,3) = "Mr."]

Former Member
0 Kudos

Sunil,

try this:

(/MBGMCR01/IDOC/E1BP2017_GM_HEAD_01[substring(BILL_OF_LADING,1,4) != "0411"] EX )

(/MT_QueryDamageIntentClaim1/Input/Input/[substring(Input1,1,3) = "Mr."] EX )

it´s important to use the EX operand in this string and as Operand, too.

Feel free to contact me.

former_member184619
Active Contributor
0 Kudos

Hi Sunil,

Use the EX opreand and give it a try with following:

/p1:MT_QueryDamageIntentClaim1/Input/Input/[starts-with(input1,'Mr.')]

It might be useful.

Sachin

Former Member
0 Kudos

Hi,

I am already using EX Opreand. this is look likes..

(/p1:MT_QueryDamageIntentClaim1/Input/Input/([substring(Input1,1,1) = "1"]) EX )

Sachin- any how in some other condition have to use substring where require condition value is in middle of value.

Thanks,

sunil Bhavsar

Former Member
0 Kudos

Sunil,

try to explain your issue more detailed pls

henrique_pinto
Active Contributor
0 Kudos

Sunil,

you have a "/" (slash) character between the last field in the XPath entry (input) and the Xpath condition evaluation (everything in brackets, "[...]"). Remove the slash between the input field and the opening bracket character ("[").

Regards,

Henrique.

Former Member
0 Kudos

Hi Henrique,

Thanks for reply.

I have tried with following condition but it isnot working...

(/p1:MT_QueryDamageIntentClaim1/Input/Input([substring(Input1,1,1) = "1"]) EX )

(/p1:MT_QueryDamageIntentClaim1/Input/Input[substring(Input1,1,1) = "1"] EX )

-Sunil

Former Member
0 Kudos

Sunil,

please post your preview output from the condition editor.

You only have to use the

/MT_QueryDamageIntentClaim1/Input/Input[substring(Input1,1,1) = "1"]

in the left operand

Operand = EX

Right Operand = empty.

only the preview should show:

(/p1:MT_QueryDamageIntentClaim1/Input/Input[substring(Input1,1,1) = "1"] EX )

Former Member
0 Kudos

remove the double quote from "Mr." and try with a single quote 'Mr.'