cancel
Showing results for 
Search instead for 
Did you mean: 

Checking condition in Expression Editor for Interface determination

hemant_chahal
Contributor
0 Kudos

Hello Experts

I am facing a problem where i have to choose between two interfaces at runtime by using simple interface determination with conditions.

the condition i have to apply is,

if "NodeF" exists -> interface 1

if "NodeF"does not exits -> interface 2

for example refer the XML instances :

<Node1>

<NodeF>1</NodeF>

<NodeG>2</NodeG>

</Node1>

so here A exists so it should go to interface 1

-


<Node1>

<NodeG>2</NodeG>

</Node1>

here It should go to interface 2

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

this should be simple. You have to create two interface mappings and two message mappings also I would imagine. Then when you get to your interface determination you specify both interfaces and both mappings. Once you save this you will then get the opportunity to add conditions where you can specify your conditions. It is much like condition receiver determination.

Of course depending on the output you could also do all of this inside one mapping and one interface mapping. But you can only do this when your receiver is using an adapter on the J2ee Engine.

hemant_chahal
Contributor
0 Kudos

My problem is same alex as i want to know how to put condition for some element if it exists and not exists in the payload.

Former Member
0 Kudos

Simply in condition editor you cannot check whether particular node/element in the paylod is exist or not.

try to map some defult value in that tag in Message mapping(based on your requirement) like T or F and based on that assign the condition in interface determination.

Thanks

Farooq.

Former Member
0 Kudos

In between try this also : [Customise your 'XPATH' Expressions|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3774] [original link is broken] [original link is broken] [original link is broken];

hemant_chahal
Contributor
0 Kudos

Farooq,

we can choose only source element not the target.

Former Member
0 Kudos

Yes I know...thats why I am saying if possible create two mapping.

one is between source to source.

and in this check wheter the source message contains that tag or not. yes then map "Y" in any dummy field if no then map "N".

now in interface mapping use the same sequence of mapping

thanks

farooq

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Hemant Chahal,

How did you solve that problem ? I am facing exactly the same issue.

Thanks in advance.

Best Regards,

Evaggelos Gkatzios

Former Member
0 Kudos

Hi,

You have 2 options.

1.Put the exits conditon in the Receier Determination.

Select the "Continue message process with following receiver" Select Service.

If the field exits then Under the configured Receivers will work.

If the field does not exit the second "Continue message process with following receiver" Receiver will continue to run the scenario.

2.If you want both in xpath condition then use below xpath condition.

/p1:ABC Parent structure/ First child structure XYZ [not(NodeF)]-Node does not exit

Regards,

Prakasu

Edited by: prakasu on Aug 18, 2008 12:07 PM

Former Member
0 Kudos

Prakasu...

Can you expand on your option #2?

2.If you want both in xpath condition then use below xpath condition.
/p1:ABC Parent structure/ First child structure XYZ not(NodeF)-Node does not exit

My source is a CREMDM idoc and I want to condition on LIFNR field existing. I also have a condition for when it exists (and uses different interface mapping).

Do you use the operator and right operand or is it all manually keyed in xpath? How should my xpath look for /CREMDM04/IDOC/E1LFA1M/ and the LIFNR not existing?

All of my trials are failing.

Thanks!

Former Member
0 Kudos

Hi Manas,

In condition editor

u have an option EX under Op which checks whether the left operand Exists or not. Right operand shud be empty.