BizTalk Server Orchestration - Rule looping --

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > October 2005 > Rule looping --





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 Rule looping --
Guru

2005-10-10, 7:51 am



I have the following schema instance

<Test>

<Server>
<Status>Success</Status>
</Server>

<Server>
<Status>Fail</Status>
</Server>

<Server>
<Status>Success</Status>
</Server>

</Test>


and my doubts are


1> I need to take a decision based on the number of Server records returned
for eg if server record count > 0 Then Do Something.......


2> I have to loop thru the server record , check for the status ,
as soon as i get status 'fail' , i have to exit from the loop.




Matt Milner

2005-10-12, 6:12 pm

You can use an xpath count function to get the value. Use the a vocabulary
item of an XML item for the count function.

For the fail, use the exists function and update the path on the left hand
side to include the test for Status='Fail'. This way you don't have to
loop, just look for a failure. If you need to, you could also do a count of
the failures much like the first suggestion and act on that number.

Matt



"Guru" <Guru@discussions.microsoft.com> wrote in message
news:1E9CD3BB-4E99-4BD0-B32E-CC110E393DAB@microsoft.com...
>
>
> I have the following schema instance
>
> <Test>
>
> <Server>
> <Status>Success</Status>
> </Server>
>
> <Server>
> <Status>Fail</Status>
> </Server>
>
> <Server>
> <Status>Success</Status>
> </Server>
>
> </Test>
>
>
> and my doubts are
>
>
> 1> I need to take a decision based on the number of Server records
> returned
> for eg if server record count > 0 Then Do Something.......
>
>
> 2> I have to loop thru the server record , check for the status ,
> as soon as i get status 'fail' , i have to exit from the loop.
>
>
>
>



Guru

2005-10-13, 6:00 pm


Thanks a lot, i used

count(/*[local-name()='Test' and
namespace-uri()='http://STMSchemaProject.SchemaTesting']/*[local-name()='Server' and namespace-uri()=''][Status="Fail"])



"Matt Milner" wrote:

> You can use an xpath count function to get the value. Use the a vocabulary
> item of an XML item for the count function.
>
> For the fail, use the exists function and update the path on the left hand
> side to include the test for Status='Fail'. This way you don't have to
> loop, just look for a failure. If you need to, you could also do a count of
> the failures much like the first suggestion and act on that number.
>
> Matt
>
>
>
> "Guru" <Guru@discussions.microsoft.com> wrote in message
> news:1E9CD3BB-4E99-4BD0-B32E-CC110E393DAB@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com