BloggingAbout.NET
Thoughts of developers

BizTalk Map: Choice Element

In my schema file, I have a choice element that only contains a single child element.  For example:

image

The above example is actually a crude schema of the where clause of a Sharepoint call to Lists.asmx where in the case I have only 1 item, I want to send a where clause of

<Where>
  <Eq>
    <FieldRef Name="ItemID"/>
    <Value Type="Text">99900</Value>
  </Eq>
</Where>

And in the case that I have multiple items, I want to send something like:

<Where>
  <Or>
    <Eq>
      <FieldRef Name="ItemID" />
      <Value Type="Text">3394</Value>
    </Eq>
...
    <Eq>
      <FieldRef Name="ItemID" />
      <Value Type="Text">9867</Value>
    </Eq>
  </Or>
</Where>

In my map, it is a simple operation of using

  • A Record Count functoid to receive a count of the number of items
  • A Greater Than functoid to compare the result of the count of items against 1
  • A Equal To functoid to compare the result of the count of items against 1

The map is then composed by connecting the items record in the source document to the Record Count functoid, the result of the Greater Than functoid to the Or choice element, and the result of the Equal To functoid to the Eq choice element.


Posted Feb 28 2008, 09:01 AM by chilberto
Filed under: ,

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Copyright © 2003-2008 BloggingAbout.NET
Powered by Community Server (Commercial Edition), by Telligent Systems