cancel
Showing results for 
Search instead for 
Did you mean: 

Xpath in the collect message of BPM

Former Member
0 Kudos

Hi,

I created a BPM collect message. My source message has a field which is in the format of XXXX-NN such that XXXX can be any 4 letters and NN is a number 01 - 99. In the loop of the BPM, I made use of an Xpath command in the condition editor for the loop condition. The command is /header/segment1/segment2[(substring(field1,6,2))] for the left hand operand and comparing it as not equal to a counter variable.

When I look at my graphical workflow log, there is an error in the Transformation step. In SXMB_MONI, I have a red flag with an error of "Message has error status on outbd. side" in the process view of SXMB_MONI.

If I change the Xpath command to /header/segment1/segment2/field1 and change the value of my field to just use NN without changing anything else, my BPM is working properly. Is there something wrong with the added Xpath command? I followed the blog in /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination but I wonder if this only works for Receiver Determination. Please help.

Regards,

Elbert

Accepted Solutions (0)

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi Elbert,

plz check out:

substring(is /header/segment1/segment2/field,6,2) on left side

Regards,

Udo

Former Member
0 Kudos

Hi Udo,

I tried your suggestion and it still produces the same error. Furthermore, I notice that since I am using BPM collect message, applying your suggestion in the condition editor resulted to the command CollectMessage./substring(/header/segment1/segment2/field,6,2) where CollectMessage is a container variable for my message. And I don't think this is correct either.

Regards,

Elbert

Former Member
0 Kudos

Is that (field1,6,2) or (field1,5,2)..check it..index starts from 0.

Former Member
0 Kudos

I based my Xpath syntax from http://www.w3.org/TR/xpath under the section "4.2 String Functions". And according to this site, "the position of the first character is 1, the position of the second character is 2 and so on." Please confirm.

udo_martens
Active Contributor
0 Kudos

Hi Elbert,

the expression

[]

means a condition and requires a

=

For example:

[//person/name[../no='123'] code]

means: select element person/name where person/no "123" is.

Because of unclear results regarding the namespace i wouldnt put the full path. Use for example [code]substring(//segment2/field,6,2)

The substring expression is ok, i m shure.

<b>substring(X-Path on String value, No of letter in string, length of searched substring)</b>

If the string is not long enough, it might give you strange errors, he, he. Cant cut 1m of 20 cm salami.

Regards,

Udo