0

我的 BizTalk 业务流程仅导入 1 行。

我无法弄清楚出了什么问题,因为没有错误消息或警告。

我在用:

  • WCF
  • 编排
  • 接收管道
  • 存储过程
  • CSV 平面文件

我认为问题出在 csv 模式中。

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://ElecFFILEImport.FFILECSVSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://ElecFFILEImport.FFILECSVSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
      <b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="true" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="FFILERoot" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="FFILERoot">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element name="Header">
          <xs:annotation>
            <xs:appinfo>
        <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Header_Row" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="unbounded" name="Detail">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="FFILECompany" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="AccountName" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="HomeAddress" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="AccountNumber" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="4" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="ServiceNumber" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="5" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="BNumber" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="6" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="DS" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="7" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="LPC" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="8" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="RDate" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="9" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="PDate" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="10" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="BOption" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="11" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="RSCode" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="12" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="CPAssigment" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="13" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Status" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="14" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

但以防万一这是一个示例文件(假数据)

FFILECompany,Account Name,Home Address,Account Number,Service Number,Bill Number,Delivery Service,LPC,RDate,PDate,BOption,RSCode,CPAssignment,Status
Company A,NORM W MYERS,0 X   WEST STREET STRONGHURST IL 61480,6996293052,439998937,5,DS1,DSHDHD-HP,2014-01-02,,BILL,,,ACTIVE
Company B,ROSABEL BLESKIN,982001 RUSTIC ST ROBINSON IL 62466,1499936152,53875283,13,DS1,RDDD-HP,2014-10-10,,BILL,,,ACTIVE
Company C,TIEE E DISNEY,140505 BEL AIRE DR BELLEVILLE IL 62299,1058999074,40564211,10,DS1,RESSS-HP,2015-01-11,2015-11-09,BILL,,,PENDING INACTIVE
Company D,STEVE BROWN,1044920 COLLEGE AVE ALTON IL 62154,1048999118,54999928,2,DS1,RSS-HP,2014-06-26,,BILL,,,ACTIVE

最后,这是我的存储过程: 如您所见,我只导入了几列:

CREATE PROCEDURE [dbo].[AccountImport]
    @Commodity NVARCHAR(255) , -- Hard Coded value inside the map
    @LDCCode NVARCHAR(2) , -- Hard Coded value inside the map
    @AccountNumber NVARCHAR(255) ,
    @AccountName NVARCHAR(255) ,
    @HomeAddress NVARCHAR(255)
AS 
    INSERT  INTO dbo.[CustomerTable]
            ( Commodity ,
              LDCCode ,
              AccountNumber ,
              AccountName ,
              HomeAddress
            )
            SELECT  @Commodity ,
                    @LDCCode ,
                    @AccountNumber ,
                    @AccountName ,
                    @HomeAddress
DECLARE @MID AS INT
SELECT @MID = @@IDENTITY                    


--This stored procedure will parse the address and separate Address city and state using a space
EXEC    [sync].[ParseAddress]   @ID = @MID

同样,没有错误,每次都导入一行(第一行)。

在此处输入图像描述

4

3 回答 3

1

确保将模式设置为信封模式以适应多条记录。请参阅以下链接 https://msdn.microsoft.com/en-us/library/aa546772.aspx http://www.codeproject.com/Articles/507336/Envelope-Schema-and-Debatching

于 2015-12-09T14:01:15.020 回答
0

确保入站模式的记录节点上的“Max发生”属性设置为“无界”

于 2019-01-18T16:56:05.527 回答
0

进入编排的消息是什么样的?如果只有一行,那么问题出在接收管道上;解决方案:

我认为您应该定义两个单独的模式,一个用于文件的标题,一个用于 csv 文件的正文。像这样填写 inf Flat File Disassembler 管道:

DocumentSchema:BodySchemaName、AssemblyName

HeaderSchema:HeaderName、AssemblyName

如果编排中的消息是完整的,没有标题,只有正文,那么问题出在映射中,所以您应该向我们提供更多信息。您映射到的架构是什么样的?

于 2018-10-18T11:30:03.867 回答