建立 PIP 文件流程資料包

由於 RosettaNet 偶爾會增加 PIP, 您可能需要建立自己的 PIP 資料包, 以支援這些新的 PIP 或支援 PIP 的更新。除非特別指出,本節中的程序將說明如何建立 PIP 5C4 V01.03.00 的 PIP 文件流程資料包。WebSphere Partner Gateway 提供 PIP 5C4 V01.02.00 的 PIP 文件流程資料包。因此, 這些程序事實上是描述如何執行升級。不過,建立 PIP 文件流程資料包和此類似, 而這些程序還會指出其他額外的步驟。

開始進行前,請先從 www.rosettanet.org 下載新版本的 PIP 規格, 如果您要執行升級,也請下載舊版本的 PIP 規格。比方說,如果您執行程序中所述的升級,請下載 5C4_DistributeRegistrationStatus_V01_03_00.zip 和 5C4_DistributeRegistrationStatus_V01_02_00.zip。規格含有下列的檔案類型:

建立或升級 PIP 文件流程資料包涉及下列程序:

建立 XSD 檔

PIP 文件流程資料包含有 XML 綱目檔,用以定義訊息格式以及元素的有效值。下列程序說明如何根據 PIP 規格檔內容, 來建立這些檔案。

您至少要為 PIP 規格檔中的每一個 DTD 檔各建一個 XSD 檔。以升級至 PIP 5C4 V01.03.00 為例, 由於訊息格式有變,程序中將說明如何將 BCG_5C4RegistrationStatusNotification_V01.03.xsd 檔建成一個範例。有關 XSD 檔的說明, 請參閱關於驗證

若要為 PIP 文件流程資料包建立 XSD 檔,請執行下列步驟:

  1. 將 DTD 檔匯入或載入到 XML 編輯器 (如 WebSphere Studio Application Developer)中。舉例來說,載入 5C4_MS_V01_03_RegistrationStatusNotification.dtd 檔。
  2. 使用 XML 編輯器,將 DTD 轉換成 XML 綱目。下列步驟說明如何使用 Application Developer 來執行此動作:
    1. 在 XML 視景的「導覽」窗格中,開啟內含所匯入之 DTD 檔的專案。
    2. 用滑鼠右鍵按一下 DTD 檔,並選取產生 > XML 綱目
    3. 在「產生」畫面中,輸入或選取新 XSD 檔的儲存位置。在「檔案名稱」欄位中, 輸入新 XSD 檔的名稱。以本例來說,您輸入的名稱可以是 BCG_5C4RegistrationStatusNotification_V01.03.xsd。
    4. 按一下完成
  3. 在新 XSD 檔中加入一些規格, 以便在 RosettaNet XML 準則中補上一些具有多個基數值的元素。準則顯示訊息中元素的方式是採用樹狀結構,並在每個元素左側顯示該元素的基數。

    一般而言,準則中的元素和 DTD 檔中之元素的定義相符。不過, 準則可含有一些同名但不同基數的元素。由於 DTD 無法提供這類情況下的基數, 您必須修改 XSD。例如,5C4_MG_V01_03_00_RegistrationStatusNotification.htm 準則檔第 15 行有一項 ContactInformation 的定義, 其中含有五個採用下列基數的子元素:

    第 150 行的 ContactInformation 定義含有四個採用下列基數的子元素:

    不過在 XSD 檔中,ContactInformation 的每一個子項都含有一個同時符合兩項定義的基數:

    <xsd:element name="ContactInformation">
       <xsd:complexType>
       <xsd:sequence>
         <xsd:element ref="contactName"/>
         <xsd:element maxOccurs="1" minOccurs="0" ref="EmailAddress"/>
           <xsd:element maxOccurs="1" minOccurs="0" ref="facsimileNumber"/>
           <xsd:element maxOccurs="1" minOccurs="0" ref="PhysicalLocation"/>
           <xsd:element maxOccurs="1" minOccurs="0" ref="telephoneNumber"/>
       </xsd:sequence>
     </xsd:complexType>
     </xsd:element>

    如果您要更新以另一版資料包為基礎的 PIP 文件流程資料包, 並想重複使用另一個版本中的定義, 請一一針對這些定義,執行下列步驟:

    1. 刪除元素的定義。例如,刪除 ContactInformation 元素。
    2. 開啟所要更換之版本的 PIP 文件流程資料包。例如,開啟 BCG_Package_RNIFV02.00_5C4V01.02.zip 檔。
    3. 尋找您要重複使用的定義。例如,BCG_ContactInformation_Types.xsd 檔中的 ContactInformation_type7 定義, 和您需要的準則第 15 行的定義相符。
      <xsd:complexType name="ContactInformation_type7">
         <xsd:sequence>
           <xsd:element name="contactName" type="common_FreeFormText_R"/>
           <xsd:element name="EmailAddress" type="common_EmailAddres_R"
               minOccurs="0"/>
           <xsd:element name="facsimileNumber"
               type="common_CommunicationsNumber_R" minOccurs="0"/>
           <xsd:element name="PhysicalLocation"
               type="PhysicalLocation_type1" minOccurs="0" />
           <xsd:element name="telephoneNumber"
               type="common_CommunicationsNumber_R minOccurs="0" />
         </xsd:sequence>
       </xsd:complexType>
    4. 在您要針對已更新之 PIP 文件流程資料包建立的新 XSD 檔中, 建立內含您要重複使用之定義的 XSD 檔的參照。例如按如下所示, 在 BCG_5C4RegistrationStatusNotification_V01.03.xsd 檔中建立 BCG_ContactInformation_Types.xsd 的參照:
      <xsd:include schemaLocation="BCG_ContactInformation_Types.xsd"/>
    5. 在新 XSD 檔中,將有參照您所刪除元素之元素的 ref 屬性。新增 type 屬性, 以參照您要重複使用的定義。例如,在 productProviderFieldApplicationEngineer 元素中, 刪除 ref="Contact Information",並加入下列資訊:
      name="ContactInformation"
        type="ContactInformation_type7"

    如果您要建立 PIP 文件流程資料包, 或者是您要升級 PIP 文件流程資料包,但您要的定義不在另一版本中, 請針對您在準則中找到的每一個元素實例, 執行下列步驟:

    1. 刪除元素的定義。例如,刪除 ContactInformation 元素。
    2. 建立更換定義。例如,建立 ContactInformation_localType1 定義,使其符合準則第 15 行中的定義。
      <xsd:complexType name="ContactInformation_localType1">
         <xsd:sequence>
           <xsd:element ref="contactName"/>
           <xsd:element maxOccurs="1" minOccurs="0" ref="EmailAddress"/>
             <xsd:element maxOccurs="1" minOccurs="0"
               ref="facsimileNumber"/>
             <xsd:element maxOccurs="1" minOccurs="0"
               ref="PhysicalLocation"/>
             <xsd:element maxOccurs="1" minOccurs="0"
               ref="telephoneNumber"/>
         </xsd:sequence>
       </xsd:complexType>
    3. 針對任何參照您要刪除之元素的元素,刪除其 ref 屬性,並新增一個 type 屬性,以參照您在前面步驟中所定義的適當複數類型。例如,在 productProviderFieldApplicationEngineer 元素中, 刪除 ref="Contact Information",並加入下列資訊:
      name="ContactInformation"
       type="ContactInformation_localType1"   

      圖 35 顯示修改前的 productProviderFieldApplicationEngineer 元素。

      圖 35. 修改前的 productProviderFieldApplicationEngineer 元素
      <xsd:element name="productProviderFieldApplicationEngineer">
         <xsd:complexType>
         <xsd:sequence>
             <xsd:element ref="ContactInformation"/>
         </xsd:sequence>
       </xsd:complexType>
       </xsd:element>

      圖 36 顯示修改後的 productProviderFieldApplicationEngineer 元素

      圖 36. 修改後的 productProviderFieldApplicationEngineer 元素
      <xsd:element name="productProviderFieldApplicationEngineer">
         <xsd:complexType>
         <xsd:sequence>
             <xsd:element name="ContactInformation"
                 type="ContactInformation_localType1"/>
         </xsd:sequence>
       </xsd:complexType>
       </xsd:element>
  4. 為只能有特定值的元素,指定列舉值。準則會將列舉值定義在 Guideline Information 區段的表格中。

    舉例來說,在 PIP 5C4 V01.03.00 訊息中,GlobalRegistrationComplexityLevelCode 只能有下列值: Above average、Average、Maximum、Minimum、None 和 Some。

    如果您要更新以另一版資料包為基礎的 PIP 文件流程資料包, 並想重複使用另一個版本中的一組列舉值, 請針對每一組執行下列步驟:

    1. 刪除該元素的定義。例如,刪除 GlobalRegistrationComplexityLevelCode 元素:
    2. 開啟所要更換之版本的 PIP 文件流程資料包。例如,開啟 BCG_Package_RNIFV02.00_5C4V01.02.zip 檔。
    3. 找出內含您要重複使用之列舉值的定義。舉例來說, BCG_GlobalRegistrationComplexityLevelCode.xsd 檔中的 _GlobalRegistrationComplexityLevelCode 定義含有 Entity Instance 表所定義的列舉值定義。
      <xsd:simpleType name="_GlobalRegistrationComplexityLevelCode">
         <xsd:restriction base="xsd:string">
           <xsd:enumeration value="Above average"/>
           <xsd:enumeration value="Average"/>
           <xsd:enumeration value="Maximum"/>
           <xsd:enumeration value="Minimum"/>
           <xsd:enumeration value="None"/>
           <xsd:enumeration value="Some"/>
           </xsd:restriction>
         </xsd:simpleType>
    4. 在您要針對已更新之 PIP 文件流程資料包建立的新 XSD 檔中, 建立內含您要重複使用之定義的 XSD 檔的參照。例如按如下所示, 在 BCG_5C4RegistrationStatusNotification_V01.03.xsd 檔中建立 BCG_GlobalRegistrationComplexityLevelCode.xsd 的參照:
      <xsd:include schemaLocation=
           "BCG_GlobalRegistrationComplexityLevelCode_Types.xsd" />
    5. 在新 XSD 檔中,將有參照您所刪除元素之元素的 ref 屬性。新增 type 屬性, 以參照您要重複使用的定義。例如,在 DesignAssemblyInformation 元素中, 刪除 ref="GlobalRegistrationComplexityLevelCode",並加入下列資訊:
               name="GlobalRegistrationComplexityLevelCode"
       type="_GlobalRegistrationComplexityLevelCode"

    如果您要建立 PIP 文件流程資料包, 或者是您要升級 PIP 文件流程資料包,但您要的列舉值定義不在另一版本中, 請針對準則中具有列舉值的任何元素, 執行下列步驟:

    1. 刪除元素的定義。例如,刪除 GlobalRegistrationComplexityLevelCode 元素。
    2. 建立更換定義。例如,建立 GlobalRegistrationComplexityLevelCode_localType 定義,並包含表格所描述的列舉值定義。
      <xsd:simpleType
           name="GlobalRegistrationComplexityLevelCode_localType">
         <xsd:restriction base="xsd:string">
           <xsd:enumeration value="Above average"/>
           <xsd:enumeration value="Average"/>
           <xsd:enumeration value="Maximum"/>
           <xsd:enumeration value="Minimum"/>
           <xsd:enumeration value="None"/>
           <xsd:enumeration value="Some"/>
           </xsd:restriction>
         </xsd:simpleType>
    3. 針對任何參照您要刪除之元素的元素,刪除其 ref 屬性,並新增一個 type 屬性,以參照您在前面步驟中所定義的適當複數類型。例如,刪除 ref="GlobalRegistrationComplexityLevelCode", 並加入下列資訊:
               name="GlobalRegistrationComplexityLevelCode"
       type="GlobalRegistrationComplexityLevelCode_localType"   

      圖 37 顯示修改前的 DesignAssemblyInformation 元素。

      圖 37. 修改前的 DesignAssemblyInformation 元素
      <xsd:element name="DesignAssemblyInformation">
         <xsd:complexType>
         <xsd:sequence>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="assemblyComments"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="demandCreatorTrackingIdentifier"/>
             <xsd:element maxOccurs="unbounded" minOccurs="0"
                ref="DesignPartInformation"/>
             <xsd:element ref="DesignRegistrationIdentification"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="GeographicRegion"/>     
             <xsd:element maxOccurs="1" minOccurs="0"
                 ref="GlobalRegistrationComplexityLevelCode"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="GlobalRegistrationInvolvementLevelCode"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="RegistrationStatus"/>
         </xsd:sequence>
       </xsd:complexType>
       </xsd:element>

      圖 38 顯示修改後的 DesignAssemblyInformation 元素

      圖 38. 修改後的 DesignAssemblyInformation 元素
      <xsd:element name="DesignAssemblyInformation">
         <xsd:complexType>
         <xsd:sequence>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="assemblyComments"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="demandCreatorTrackingIdentifier"/>
             <xsd:element maxOccurs="unbounded" minOccurs="0"
                ref="DesignPartInformation"/>
             <xsd:element ref="DesignRegistrationIdentification"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="GeographicRegion"/>     
             <xsd:element maxOccurs="1" minOccurs="0"
                name="GlobalRegistrationComplexityLevelCode"
                  type="GlobalRegistrationComplexityLevelCode_localType"/>
       
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="GlobalRegistrationInvolvementLevelCode"/>
             <xsd:element maxOccurs="1" minOccurs="0"
                ref="RegistrationStatus"/>
         </xsd:sequence>
       </xsd:complexType>
       </xsd:element>
  5. 設定資料實體的資料類型、長度下限、長度上限和表示法。RosettaNet XML Message Guidelines 將此資訊提供於 Fundamental Business Data Entities 表中。

    如果您要更新以另一版資料包為基礎的 PIP 文件流程資料包, 並想重複使用另一個版本中的某項資料實體定義, 請針對每一組執行下列步驟:

    1. 刪除該資料實體元素的定義。例如,刪除 DateStamp 元素。
    2. 開啟您要更換之版本的 PIP 文件流程資料包。 例如,開啟 BCG_Package_RNIFV02.00_5C4V01.02.zip 檔。
    3. 尋找您要重複使用的定義。舉例來說,BCG_common.xsd 檔中的 _common_DateStamp_R 定義含有下列定義,而該定義符合準則所提供的資訊:
      <xsd:simpleType name="_common_DateStamp_R">
         <xsd:restriction base="xsd:string">
           <xsd:pattern value="[0-9]{8}Z" /> 
           </xsd:restriction>
         </xsd:simpleType>
    4. 在您要針對已更新之 PIP 文件流程資料包建立的新 XSD 檔中, 建立內含您要重複使用之定義的 XSD 檔的參照。例如按如下所示, 在 BCG_5C4RegistrationStatusNotification_V01.03.xsd 檔中建立 BCG_common.xsd 的參照:
      <xsd:include schemaLocation="BCG_common.xsd" />
    5. 在新 XSD 檔中,將有參照您所刪除元素之元素的 ref 屬性。新增 type 屬性, 以參照您要重複使用的定義。例如,在 DesignAssemblyInformation 元素中, 刪除 ref="DateStamp",並加入下列資訊:
      name="DateStamp" type="_common_DateStamp_R"  

    如果您要建立 PIP 文件流程資料包, 或者是您要升級 PIP 文件流程資料包,但您要的資料實體定義不在另一版本中, 請針對每一個資料實體元素,執行下列步驟:

    1. 刪除元素的定義。例如,刪除 DateStamp 元素。
    2. 建立更換定義。舉例來說,使用資料類型、長度下限、長度上限和表示法資訊, 來建立 DateStamp_localType 定義。
      <xsd:simpleType name="DateStamp_localType">
         <xsd:restriction base="xsd:string">
           <xsd:pattern value="[0-9]{8}Z" /> 
           </xsd:restriction>
         </xsd:simpleType>
    3. 針對任何參照您要刪除之元素的元素,刪除其 ref 屬性,並新增一個 type 屬性,以參照您在前面步驟中所定義的適當複數類型。例如, 刪除 ref="DateStamp",並加入下列資訊:
      name="DateStamp" type="DateStamp_localType"

      圖 39 顯示修改前的 beginDate 元素。

      圖 39. 修改前的 beginDate 元素
      <xsd:element name="beginDate">
         <xsd:complexType">
         <xsd:sequence>
             <xsd:element ref="DateStamp"/> 
         </xsd:sequence>
       </xsd:complexType>
       </xsd:element>

      圖 40 顯示修改後的 beginDate 元素。

      圖 40. 修改後的 beginDate 元素
      <xsd:element name="beginDate">
         <xsd:complexType">
         <xsd:sequence>
             <xsd:element name="DateStamp" type="DateStamp_localType"/> 
         </xsd:sequence>
       </xsd:complexType>
       </xsd:element>

建立 XML 檔

在您為 PIP 文件流程資料包建立 XSD 檔後, 即可準備為 RNIF 資料包和「後端整合」資料包建立 XML 檔。舉例來說, 假設這些資料包名稱為 BCG_Package_RNIFV02.00_5C4V01.03.zip 和 BCG_Package_RNSC1.0_RNIFV02.00_5C4V01.03.zip。下列程序說明如何為 RNIF 資料包建立 XML 檔:

  1. 從 RNIF PIP 文件流程資料包檔案擷取 XML 檔。如果您要升級, 請從舊版資料包(如 BCG_Package_RNIFV02.00_5C4V01.02.zip)擷取檔案。如果您要建立新資料包, 請從和您要建立之 PIP 文件流程資料包類似的資料包中擷取檔案。比方說,如果您要建立一個資料包以支援雙動作 PIP, 請複製另一個雙動作 PIP 資料包中的 XML 檔。
  2. 複製檔案,並給予一個適當名稱(例如 BCG_RNIFV02.00_5C4V01.03.xml)。
  3. 在新檔案中,更新內含 PIP 相關資訊的元素。舉例來說, 下表列出 5C4 PIP 範例中您要更新的資訊。請注意,這裡的資訊可能會在檔案中出現多次。請確定您已更新所有的實例。
    表 37. 5C4 PIP 更新資訊
    要變更的資訊 舊值 新值
    PIP ID 5C4 5C4
    PIP 版本 V01.02 V01.03
    要求訊息 DTD 檔的名稱,不使用副檔名 5C4_MS_V01_02_
    RegistrationStatusNotification
    5C4_MS_V01_03_
    RegistrationStatusNotification
    確認訊息 DTD 檔的名稱,不使用副檔名(僅適用於雙動作 PIP) N/A N/A
    要求訊息 XSD 檔的名稱,不使用副檔名 BCG_5C4RegistrationStatus
    Notification_V01.02
    BCG_5C4RegistrationStatus
    Notification_V01.03
    確認訊息 XSD 檔的名稱,不使用副檔名(僅適用於雙動作 PIP) N/A N/A
    要求訊息 XSD 檔中的根元素名稱 Pip5C4RegistrationStatus
    Notification
    Pip5C4RegistrationStatus
    Notification
    確認訊息 XSD 檔中的根元素名稱;僅適用於雙動作 PIP N/A N/A
  4. 開啟 PIP 規格文件,並使用它來更新下列表格中的資訊。如果您要執行更新, 請比較版本的規格,因為您有可能不需要更新這些值。
    表 38. PIP 規格中的 5C4 PIP 更新資訊
    要更新的資訊 說明 5C4 資料包中的值
    活動名稱 表 3-2 中的指定 配送登錄狀態
    起始者的角色名稱 表 3-1 中的指定 產品提供者
    回應者的角色名稱 表 3-1 中的指定 需求建立者
    要求動作名稱 表 4-2 中的指定 登錄狀態通知
    確認動作名稱 表 4-2 中的指定(僅適用於雙動作 PIP) N/A
  5. 更新資料包屬性值。如果您要執行更新, 請比較版本的規格,因為您有可能不需要更新這些值。
    註: 如果您要建立「後端整合」資料包, 請跳過此步驟,並移至步驟 6
    表 39. 5C4 PIP 屬性的更新
    要更新的資訊 說明 5C4 資料包中的值 XML 檔中的元素路徑
    NonRepudiation
    Required
    表 3-3 中的指定 N ns1:Package
    ns1:Protocol
    ns1:Process
    ns1:Attribute(其 ATTRIBUTEKEY 為 NonRepudiationRequired)
    ns1:AttributeValue
    AttributePickListItem
    ATTRVALUEKEY
    NonRepudiationOf
    Receipt
    表 3-3 中的指定 N ns1:Package
    ns1:Protocol
    ns1:Process
    ns1:Attribute(其 ATTRIBUTEKEY 為 NonRepudiationOfReceipt)
    ns1:AttributeValue
    AttributePickListItem
    ATTRVALUEKEY
    DigitalSignature
    Required
    表 5-1 中的指定 Y ns1:Package
    ns1:Protocol
    ns1:Process
    ns1:Attribute(其 ATTRIBUTEKEY 為 DigitalSignatureRequired)
    ns1:AttributeValue
    AttributePickListItem
    ATTRVALUEKEY
    TimeToAcknowledge 表 3-3 中的指定 2
    (120 分鐘)
    ns1:Package
    ns1:Protocol
    ns1:Process
    ns1:Attribute(其 ATTRIBUTEKEY 為 TimeToAcknowledge)
    ns1:AttributeValue
    ATTRVALUE
    TimeToPerform 表 3-3 中的指定 2
    (120 分鐘)
    ns1:Package
    ns1:Protocol
    ns1:Process
    ns1:Attribute(其 ATTRIBUTEKEY 為 TimeToPerform)
    ns1:AttributeValue
    ATTRVALUE
    RetryCount 表 3-3 中的指定 3 ns1:Package
    ns1:Protocol
    ns1:Process
    ns1:Attribute(其 ATTRIBUTEKEY 為 RetryCount)
    ns1:AttributeValue
    ATTRVALUE
  6. 更新 ns1:Package/ns1:Protocol/GuidelineMap 元素,以移除用不到的 XSD 檔,並新增任何您所建立或參照的 XSD 檔。

若要建立「後端整合」資料包, 請重複步驟 16, 只是其差異處如下:

在您建立 XML 和 XSD 檔後,即可準備建立 PIP 文件流程資料包。

建立資料包

若要建立 RNIF 資料包,請執行下列步驟:

  1. 建立 GuidelineMaps 目錄,並將資料包的 XSD 檔複製到這個目錄中。
  2. 建立 Packages 目錄,並將 RNIF XML 檔複製到這個目錄中。
  3. 移至母目錄,並建立一個內含 GuidelineMaps 和 Packages 目錄的 PIP 文件流程資料包(ZIP 檔)。您必須保留 ZIP 檔中的目錄結構。

若要建立「後端整合」資料包,請執行步驟 13, 但請使用後端整合 XML 檔,而非 RNIF 檔。

在您建立 PIP 資料包後,可使用RNIF 和 PIP 文件流程資料包中的程序將它上傳。

Copyright IBM Corp. 2003, 2005