The flat file output may not contain the flat file delimiters as expected in BizTalk Server 2006 and in BizTalk Server 2004 (914590)
The information in this article applies to:
- Microsoft BizTalk Server 2006 Standard Edition
- Microsoft BizTalk Server 2006 Enterprise Edition
- Microsoft BizTalk Server 2006 Developer Edition
- Microsoft BizTalk Server 2004 Standard Edition
- Microsoft BizTalk Server 2004 Developer Edition
- Microsoft BizTalk Server 2004 Enterprise Edition
- Microsoft BizTalk Server 2004 Partner Edition
SYMPTOMSIn Microsoft BizTalk Server 2006 and in Microsoft BizTalk Server 2004, the flat file output may not contain the flat file delimiters as expected. This behavior may occur when you process a message by using a custom pipeline that contains the Flat File Assembler pipeline component.
For example, if the message that the custom pipeline processes contains a missing record, the flat file output may not contain the flat file delimiters. The flat file delimiters may not appear in the output file depending on the position of the missing record in the input file.WORKAROUNDTo work around this behavior, use a map and a custom scripting functoid to make sure that an empty record is created when the input file does not contain the record. To do this, follow these steps: - Set the following properties on the potentially empty nodes in the document schema for the Flat File Assembler pipeline component:
- Set the Preserve Delimiter for Empty Data property to the Yes value.
- Set the Suppress Trailing Delimiter property to the No value.
- On the root node, set the Generate Empty Nodes property to the True value.
- Add a new map to the BizTalk project. In this map, use the document schema for the Flat File Assembler pipeline component as the source schema and as the destination schema.
- In the map that you created in step 2, map the source fields that are not empty to the corresponding destination fields.
- For the fields that may be empty in the input file, use a scripting functoid to return an empty string when the record is missing. The following code example for the scripting functoid demonstrates how to do this.
public string ValOrEmpty(string val)
{
return (val.Length > 0) ? val : "";
}
Note You must create a script that has a unique function name for each potentially empty field that you map. For example, if you have three potentially empty fields, you may have functions that are named the following:- The ValOrEmpty1 function
- The ValOrEmpty2 function
- The ValOrEmpty3 function
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 5/3/2006 |
---|
Keywords: | kbcode kbBTS kbtshoot kbprb KB914590 kbAudDeveloper kbAudITPRO |
---|
|