cancel
Showing results for 
Search instead for 
Did you mean: 

BPM: XPath-Condition in Switch Step

Former Member
0 Kudos

Hello,

I have the following requirement in BPM.

There is a switch step with five branches, and I have the following document structure:

<Root>

<Segment>

<Docnum> 12345 </Docnum>

</Segment>

<Segment>

<Docnum> 12346 </Docnum>

</Segment>

</Root>

The switch condition is done based on the last digit of the first Docnum element. So in this case the value would be 5.

I tried to work with a substring as the total number of digits of docnum is always 5.

How would an XPath expression look like to retrieve the substring from the first <Segment> element? I tried different combinations but none of them really worked.

Example what I tried: p1:/root/Segment[1]/substring(docnum, 4,1)

Any advise on this?

Thank you very much

Accepted Solutions (0)

Answers (3)

Answers (3)

prabhu_s2
Active Contributor
0 Kudos
udo_martens
Active Contributor
0 Kudos

Hi Florian,

simply

substring(//Docnum,5,1)

should work.

Regards,

Udo

Former Member
0 Kudos

Try this...

substring(/p1:/root/Segment[1]/docnum,4,1)

for more info see

http://www.w3.org/TR/xpath

Message was edited by:

Alex