BRE - Evaluate a collection of elements?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > BRE - Evaluate a collection of elements?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-06 03:47 PM

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>






[ Post a follow-up to this message ]



    Re: BRE - Evaluate a collection of elements?  
Randal van Splunteren


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-06 03:47 PM

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 proper
ties
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>







[ Post a follow-up to this message ]



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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-06 03:47 PM

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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:33 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register