Mohsin Kalam’s Blog

Envelope Application

Goal:

Send Pipeline supports three modes of serialization with varying functionality in each mode. In each mode, it applies/updates the envelopes of the outgoing document. This post describes the behavior of Send Pipeline Envelope Application in each of the 3 modes .

1. Individual Transaction Sets:

X12:

X12 documents have one ISA segment with an accompanying IEA trailer and one or more GS segments with an accompanying GE segments. One GS segment can contain only one type of transaction set so the number of GS segments within an interchange is mapped directly to the number of distinct transaction sets within that interchange. For example a document containing 2 810 documents and 4 850 documents will have 2 GS segments.

To avoid redundancy, all page references when a Party is resolved are located under “X12 Properties/Party as Interchange Receiver” for that Party. For Global Settings, the page is located under “X12 Properties“.

ISA/IEA Segment:

ISA segment is constructed from fields specified under “X12 Interchange Envelope Generation/ISA Segment Definition“.

  • This page specifies all the delimiters used during serialization
  • ISA13 is the interchange control number and gets incremented after every successive serialization
  • IEA segment is contructed on the fly where
    • IEA01 contains the number of groups within an interchange. In this mode it is always 1
    • IEA02 is the interchange control number and is copied from ISA13 in the instance

GS/GE Segment:

GS segment is constructed from fields specified under “X12 Interchange Envelope Generation/GS and ST Segment Definition“.

  • The fields in global properties are fixed meaning you can only specify one GS envelope for all documents
  • At the party level, R2 allows users to specify different GS headers for different Doc Types according to the following process
    • If the ST1, Version/Release and the TargetNameSpace specified in PAM match the values in the instance, the GS segment is constructed from that row
      • ST1, Version/Release and TargetNameSpace are present in the first line of XML file
    • If no match happens, the default row is selected.
    • If the default row is not specified by the user, the message is suspended and an appropriate error logged to the event viewer
  • GS06 is the group control number and gets incremented after every successive serialization
  • GE segment is constructed on the fly where
    • GE01 contains the number of Transaction Sets within a group. In this mode it is always 1
    • GE02 is the group control number and is copied from GS06 in the instance

ST/SE Segment:

ST segment is constructed from fields specified under “X12 Interchange Envelope Generation/GS and ST Segment Definition“.

  • ST02 is the transaction set control number. If “Apply new ID” field is checked, ST02 is updated in the instance and incremented after every successive serialization. Otherwise it remains as is.
  • SE segment is constructed on the fly where
    • SE01 contains the number of segments within a transaction set and is auto corrected by the send pipeline in case of a mismatch. If this happens, a warning is logged in the event viewer
    • SE02 is the transaction set control number and is copied from ST02 in the instance

EDIFACT:

EDIFACT documents have an optional UNA segment, a mandatory UNB segment with the accompanying UNZ trailer and an optional UNG header with the accompanying UNE trailer. If the UNG header is present, then like X12, all transaction sets of the same type go within that header. If no UNG header is present, transaction sets of any type in any order can be grouped under the UNB segment.

To avoid redundancy, all page references when a Party is resolved are located under “EDIFACT Properties/Party as Interchange Receiver” for that Party. For Global Settings, the page is located under “EDIFACT Properties“.

UNA Segment:

UNA segment is constructed from fields specified under “EDIFACT Interchange Envelope Generation/UNA Segment Definition“.

  • This page specifies all the delimiters used during serialization
  • UNA is an optional field per EDIFACT standard, and is only created when the option “Generate UNA segment” is checked. In both cases, the delimiters specified on this page are used during serialization

UNB/UNZ Segment:

UNB segment is constructed from fields specified under “EDIFACT Interchange Envelope Generation/UNB Segment Definition“.

  • UNB5 is the interchange control number and gets incremented after every successive serialization
  • UNZ segment is constructed on the fly where
    • UNZ1 contains either the number of groups or the number of transaction sets in an interchange. In this mode it is always 1
    • UNZ2 is the interchange control number and is copied from UNB5 in the instance

UNG/UNE Segment:

UNG segment is constructed from fields specified under “EDIFACT Interchange Envelope Generation/UNG and UNH Segment Definition“.

  •  UNG is an optional field per EDIFACT standard, and is only generated when the option “Create grouping segments” is checked
  • The fields in global properties are fixed meaning you can only specify one UNG envelope for all documents
  • At the party level, R2 allows users to specify different UNG headers for different Doc Types according to the following process
    • If the UNH2.1, UNH2.2, UNH2.3, UNH2.5 and the TargetNameSpace specified in PAM match the values in the instance, the UNG segment is constructed from that row
      • UNH2.1, UNH2.2, UNH2.3, UNH2.5 and the TargetNameSpace are present in the first line of XML file
    • If no match happens, the default row is selected.
    • If the default row is not specified by the user, the message is suspended and an appropriate error logged to the event viewer
  • UNG5 is the group control number and gets incremented after every successive serialization
  • UNE segment is constructed on the fly where
    • UNE1 contains the number of Transaction Sets within a group. In this mode it is always 1
    • UNE2 is the group control number and is copied from UNG5 in the instance

UNH/UNT Segment:

UNH segment is constructed from fields specified under “EDIFACT Interchange Envelope Generation/UNG and UNH Segment Definition“.

  • UNH1 is the transaction set control number. If “Apply new ID” field is checked, UNH1 is updated in the instance and incremented after every successive serialization. Otherwise it remains as is.
  • UNT segment is constructed on the fly where
    • UNT1 contains the number of segments within a transaction set and is auto corrected by the send pipeline in case of a mismatch. If this happens, a warning is logged in the event viewer
    • UNT2 is the transaction set control number and is copied from UNH1 in the instance

2. BIBO Message:

In this mode, the envelope information is already present in the interchange along with all the delimiters so that information is used as is. The only fields that Send Pipeline auto corrects, based on a mismatch, are the fields that store the number of segments/transaction sets/groups. These fields for X12 are IEA01, GE01 and SE01. For EDIFACT they are UNZ1, UNE1 and UNT1. In case of SE01 and UNT1 being auto corrected, a warning is logged in the event viewer.

3. Batch Message:

Like a BIBO message, the Batch message contains all the envelope information. Unlike BIBO where only the count is auto corrected, many fields are updated by the Send Pipeline in a Batch Message. Also Batch message is party dependent, meaning if a party cannot be resolved for the message, it will be suspended.

The following fields are updated by the Send Pipeline.

X12:

ISA1, ISA2, ISA3, ISA4, ISA9, ISA10, ISA13, GS4, GS5, GS6, ST2

EDIFACT:

UNB4.1, UNB4.2, UNB5, UNG4.1, UNG4.2, UNG5, UNG8, UNH1

  • All these fields come from the fields in the Party Settings using the same process as already explained above

End Note:

I hope this post has been useful in understanding the EDI Send Envelope Application process. Your comments/questions are always welcome.

Thanks

Mohsin Kalam

4 Comments »

  1. I have a question, lets say we want to map X12 to X12 and RETAIN all ISA, GS ST Control numbers does BTS 06 Support that or do we have to write a custom pipeline for that? Any direction would be greatly appreciated, that is the last piece to our puzzle as we have found work arounds for Party resolution and other tasks that we found during our conversions, is it possible to use the output from the message enrichment SDK solution in a send pipeline for EDI output validation. We want to be able to take advantage of the mapping capablitites and database but dont want to lose anything from the original file we want to pass ALL data thru maps and send ports.

    Mike

    Comment by Mike — January 25, 2008 @ 5:57 am

  2. This is a pretty popular ask from biztalk r2 users, however I am not aware of this scenario. I will investigate and get back to you with my findings.

    Mohsin

    Comment by Mohsin Kalam — January 28, 2008 @ 12:02 pm

  3. I have a UNB6.1 (reference password) on an incoming message from customer that is received as several blanks….
    (on his side it’s a real password off course)

    If I try and enter this into the EDIFACT partyproperties…I get an error.
    One blank biztalk can handle. (and if I adapt the message so only one blank is there it works)

    How could I treat a message coming in like this?

    Isabelle

    Comment by isabelle — April 1, 2008 @ 3:46 am

  4. We have identified this as a possible bug in the product and are investigating the root cause. Once we reach a decision, I will update it here.

    Thanks
    Mohsin

    Comment by Mohsin Kalam — April 22, 2008 @ 2:45 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: