cancel
Showing results for 
Search instead for 
Did you mean: 

BPM switch condition xPath

Former Member
0 Kudos

All,

Inside the BPM there is a switch condition -

which checks whether ( InXML\Item1\Key = "COMPNAME" AND InXML\Item1\Value="HRB" ) - if this condition is true, then it sends the whole xml to a particular receiver.

For this condition to work - does the Item1 node (with COMPNAME key value) be first? Currently we are getting it in random places within the Item1 nodes.

Sample Input message -

<InXML>

<Item1>

<Key>CODE</Key>

<Value>CC</Value>

</Item1>

<Item1>

<Key>COMPNAME</Key>

<Value>HRB</Value>

</Item1>

<Item1>

<Key>REGSTATUS</Key>

<Value>Y</Value>

</Item1>

<Item1>

<Key></Key>

<Value></Value>

</Item1>

</InXML>

Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

All, thanks for the input. There is a checkbox while we specify the xPath in the BPM condition editor for multiline elements. That resolved my issue, without changing anything.

Former Member
0 Kudos

Hi,

In a branch of a switch case you specify a condition in a branch, when the msg comes it will check the key and value for each item1(in your case) and execute the branch accordingly. if no branch condition satisfies then executes Otherwise branch.

**Reward points if helpful

--Sankar Choudhury

Former Member
0 Kudos

The following weblog will give you some hints:

XPath to show the path (Multiple Receivers)

/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

Liang

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi

yes it must be first always,

because PI read the IDOC from top to end and if you have COMPNAME later of field VALUE the condicion will be false always

Thanks

Rodrigo

Edited by: Rodrigo Pertierra on Mar 27, 2008 2:19 PM

Former Member
0 Kudos

I think my initial question is not clear... let me rephrase it.

In the following XML there are 4 Item1 nodes. Does the one that is bold (this is the one that will satisfy the condition), need to be the first in the 4 or will it work immaterial of the position within the Item1 node collection?

<InXML>

<Item1>

<Key>CODE</Key>

<Value>CC</Value>

</Item1>

<Item1>

<Key>COMPNAME</Key>

<Value>HRB</Value>

</Item1>

<Item1>

<Key>REGSTATUS</Key>

<Value>Y</Value>

</Item1>

<Item1>

<Key></Key>

<Value></Value>

</Item1>

</InXML>

justin_santhanam
Active Contributor
0 Kudos

Rkk,

I believe it checks only the first value. What you can do is, just keep transformation before switch step. The mapping program must be responsible for bringing the <Key>COMPNAME</Key> that elements to the topmost level. or there are lot of possibilities.

raj.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi, RK

in this case, it must be first, becuase the BPM don have a context change, only take the fisrt value.

Thanks

Edited by: Rodrigo Pertierra on Mar 27, 2008 4:41 PM