Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Creating Dummy record for Conditional Looping
- This topic has 2 replies, 1 voice, and was last updated 9 years, 4 months ago by
community-content.
-
AuthorPosts
-
-
April 6, 2010 at 1:13 PM #24514
Hi Guys,
I have a scenario in which i should check for the records in the source document upon a condition (field >0) and if there are no records matching that particular condition ,i need to create a dummy record in the destination with all empty values..
Please give me any suggestions for this scenario ..
-
April 6, 2010 at 2:20 PM #24515
Well, What you have done so far? I am trying to describe general steps here: (I assume you are using orchestration)
For your easiness you can Create a distinguished field for e.g. field1 in your case to check the condition within the loop. The loop will have one record at a time if you have multiple records. based on the condition result you can create/change XML message.
The alternative is to try to read the value of field directly using xpath. You can also change the XML after checking condition. To know using xpath please refer these posts:
http://geekswithblogs.net/sthomas/archive/2004/10/25/13269.aspx
-
April 6, 2010 at 6:42 PM #24521
Actually I am using a map ,I need to create a record in my destination based on a condition on the input record which is unbounded .So ,I used conditional looping to filter and map records which i need in the output .Now,if i dont have any record in the input matching the condition ,then i need to create a dummy record in the destination with all fields empty values.
Source
<Record>
<field1>NY</field1>
<field2>New York</field2>
</Record>
<Record>
<field1>NY</field1>
<field2>Brooklyn</field2>
</Record>
<Record>
<field1>NJ</field1>
<field2>Trenton</field2>
</Record>
My condition is field1==NY .I need the records with this condition,if any otherwise destination node should be one record with empty values in all fields.
Which is the best way to handle this in a map,using table looping functoid,or some other functoids or writing an inline xslt script ?
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.