BizTalk平面文件架构 - 嵌套重复记录

时间:2014-08-26 13:46:56

标签: nested schema biztalk records

我正在尝试映射这个示例的模式,它在重复记录中重复记录。

示例文件:

0000456Toy Industries56Palumbia DriveEnfield   CT06082  98724
302369097   King Toy Store20 Cherry WayDedhamMA02026  TS2349
402369097   036436 Playstation 4 Entert03452449.99  20140826
402369097   036437 Msoft XBOX ONEEntert01234399.99  20140826
402369097   036438 Wooden Horse        07892 59.99  20140827
402369097   036439 Playstation 4 Entert03452449.99  20140827
402369097   036440 My First Brew Kit    99.99  20140828
602369097000100010005I
302369235   Make Believe 342 Brand DriveBridgeMA02324  TS5439
402369235   054324 Playstation 4 Entert53452449.99  20140827
402369235   054325 Steam Box Ultimate  54234699.99  20140827
602369235000100010002I
900033336133310001    

序列:

<Processor Record> (one per file | 1)
    <Store Record> (one per store | 1+)
        <Order Record> (one for each order the store had | 1+)
    <Store Batch Control Record> (one per store | 1+)
<File Batch Control Record> (one per file | 1)

每个记录(行)将按位置规范分为字段元素

我尝试过多次使用该向导并手动调整设置,但仍然遇到类似这样的问题:

The current definition being parsed is Root. The stream offset where the error occurred is 0. The line number where the error occurred is 1. The column where the error occurred is 0.

我是BizTalk的新手,并希望有人能够就如何完成这项任务给我一些帮助。谢谢!

1 个答案:

答案 0 :(得分:2)

使用标签标识符来指示记录类型。

在您的情况下,这将是:

00 Processor Record Header
30 Store Record Header
40 Order Record
60 Store Record Summary
90 Processor Record Summary

我就是这样做的:

您将拥有一个包含以下参数的根节点:

Structure: delimited
Child Delimiter Type: hexadecimal
Child delimiter: 0x0a 0x0d (newline character of your choice)
Child Order: Infix

下面的节点将是&#34; Header&#34;节点

它的属性:

Max Occurs: 1
Min Occurs: 1
Structure: positional
Tag Identifier: 00

下一个节点将是&#34; Store&#34;节点。 这是一个抽象节点,只是为了能够捕获商店标题,定期订单记录和商店摘要节点。

它的属性:

Max Occurs: *
Min Occurs: 0 (depending what's possible on your flat file)
Structure: delimited
Child Delimiter Type: hexadecimal
Child delimiter: 0x0a 0x0d (newline character of your choice)
Child Order: Infix

下面的节点将是&#34; StoreHeader&#34;节点

Max Occurs: 1
Min Occurs: 0 (depending what's possible on your flat file)
Structure: positional (only you know the exact sequence of fields)
Tag Identifier: 30

接下来,&#34;订单&#34;节点:

Max Occurs: *
Min Occurs: 0 (depending what's possible on your flat file)
Structure: positional (only you know the exact sequence of fields)
Tag Identifier: 40

接下来,&#34; StoreSummary&#34;节点:

Max Occurs: 1
Min Occurs: 0 (depending what's possible on your flat file)
Structure: positional (only you know the exact sequence of fields)
Tag Identifier: 60

最后,与&#34; Header&#34;处于同一级别。和&#34; Store&#34;节点,你会得到&#34;摘要&#34;节点:

Max Occurs: 1
Min Occurs: 1
Structure: positional
Tag Identifier: 90