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 Thu, Feb 28 2008 9:01 AM by chilberto
Filed under: ,

Comments

Rodrigo wrote re: BizTalk Map: Choice Element
on Mon, Feb 15 2010 3:13 PM

I'm just trying to solve a similar issue by using the existence functoid to identify the corresponding choice element and value mapping functoids to map the values. Is there a reason that made you discard that option?

Add a Comment

(required)  
(optional)
(required)  
Remember Me?

Please add 6 and 7 and type the answer here:
Copyright © 2003-2010 BloggingAbout.NET