BizTalk Server General - BRE - Evaluate a collection of elements?

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > February 2006 > BRE - Evaluate a collection of elements?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author BRE - Evaluate a collection of elements?
vt_asparagus@yahoo.com

2006-02-26, 10:47 am

Hi all,

Look at the XML structure below. I need a business rule that says that
if there is a single Non-Standard item (IsStandard=0) then the Request
as a whole needs to be treated as Non-Standard. Although, we are
having problems building this rule easily because BRE seems to only
evaluate first IsStandard element. Does anyone know of a way to
iterate over all of IsStandard elements in the BRE?

<Request>
<Items>
<Item>
<Number>111</Number>
<IsStandard>1</IsStandard>
</Item>
<Item>
<Number>222</Number>
<IsStandard>0</IsStandard>
</Item>
<Item>
<Number>333</Number>
<IsStandard>1</IsStandard>
</Item>
</Items>
</Request>

Randal van Splunteren

2006-02-26, 10:47 am

Hello vt_asparagus@yahoo.com,

You should create a rule that has a 'exists in' predicate.
Use the following Xpath at the left side of this predicate:

/Item[IsStandard=0]

For the right side use:

/Request/Items

This will make the rule engine loop over all the 'Item' nodes inside the
'Items' and check all the is standard nodes.

You build this rule by adjusting the standard XPath statements in the properties
window of you XML schema.

HTH,
Randal van Splunteren
http://biztalkia.blogspot.com

> Hi all,
>
> Look at the XML structure below. I need a business rule that says
> that if there is a single Non-Standard item (IsStandard=0) then the
> Request as a whole needs to be treated as Non-Standard. Although, we
> are having problems building this rule easily because BRE seems to
> only evaluate first IsStandard element. Does anyone know of a way to
> iterate over all of IsStandard elements in the BRE?
>
> <Request>
> <Items>
> <Item>
> <Number>111</Number>
> <IsStandard>1</IsStandard>
> </Item>
> <Item>
> <Number>222</Number>
> <IsStandard>0</IsStandard>
> </Item>
> <Item>
> <Number>333</Number>
> <IsStandard>1</IsStandard>
> </Item>
> </Items>
> </Request>



vt_asparagus@yahoo.com

2006-02-26, 10:47 am

That worked.

The only thing I have now noticed, is that if I create a vocabulary for
that xpath and then drag and drop into my rule, it does not show the
nice vocabulary name.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com