none
How can I manipulate the ISA GS Segments on the fly? RRS feed

  • Question

  •  

    It seems tha these are set within the parties property box, 

    Is there a way to access these segments and somehow change the value on the instance I am sending out?

     

    If it was in the schema it would be easy by functoid.

    However, it's an auto generated wrapper. So while i can manipulate it, the manipulations are static done through a menu not allowing for a different value per transaction. 

     

    The only other thing I can think of is to have it send to another process that would strip out my static value and enter in the actual value.

     

    Thank you in advance:

    Mark

    Tuesday, May 6, 2008 2:36 PM

Answers

  •  

    In R2 we don't support it out of box. You need to write custom pipeline component to workaround it.
    Wednesday, May 7, 2008 11:55 PM
  • How I fixed this.

    I created a temporary OUt via MLLP and sent that to a new orchestration used the flat file schema creation then parsed out the NM109  and used a genaric map to through it to the GS08 segment.  Then I used that same flat file to generate the output pipeline.

     

    Monday, May 12, 2008 6:53 PM
  •  

    Greetings!

     

    In these days I have been experimenting an EDI Error regarding ISA12 (interchange control version number)

     

    Let me explain:

    When an incoming message has the following ISA Values, Biztalk is throwing an error regarding “Invalid versionId”

     

    ISA*04*SW426     *00*          *02*RRDC           *02*KCS            *080512*1247*U*00503*001651461*0*P*;~

    Error: 1 (Miscellaneous error)

       17: Invalid VersionId

    Error: 2 (Field level error)

       SegmentID: ISA

       Position in TS: 1

       Data Element ID: ISA12

       Position in Segment: 12

       Data Value: 00503

       7: Invalid code value

     

    I have created the corresponding parties and the messages are processed successfully as long as the messages have an ISA12 value prior to 00503.

    I was looking to modify the service extension schema (http://msdn.microsoft.com/en-us/library/bb246017.aspx) however the ISA12 is not available on that schema.

     

    I have not found a solution yet, so I have actually begun to create a Custom Pipeline Component and modify the EDI envelope in order to replace the ISA12 value for 00502 version. However I am getting the error: "Duplicate transaction set...."

     

    This is part of my custom code on decoder stage:


    public ... Execute(IPipelineContext pc, IBaseMessage inmsg)
    {

    IBaseMessagePart bodyPart = inmsg.BodyPart;
    Stream originalStream = bodyPart.GetOriginalDataStream();

    int numberBytesToRead = (int)originalStream.Length;
    int numberBytesRead = 0;

    byte[] outBytes = new byte[numberBytesToRead];

    int bytes = originalStream.Read(outBytes, numberBytesRead, numberBytesToRead);

    string outboundEDI = System.Text.Encoding.Default.GetString(outBytes);


    //Replace ISA12
    string [] splitEDI = outboundEDI.Split(new Char [] {'*'});
    if (splitEDI.Length > 0 && splitEDI[12] != null)
    {
          int controlVersion = System.Convert.ToInt32(splitEDI[12].ToString());
          if (502 < controlVersion)
          {
              outboundEDI = outboundEDI.Replace(splitEDI[12].ToString(),
    "000502");
          }
    }

    byte[] newEDIBytes =
    System.Text.Encoding.ASCII.GetBytes(outboundEDI.ToString());

    MemoryStream memStream = new MemoryStream();
    memStream.Write(newEDIBytes, 0, newEDIBytes.Length);
    memStream.Position = 0;

    bodyPart.Data = memStream;
    pc.ResourceTracker.AddResource(memStream);

    return inmsg;

    }

    Any of you know how to accomplish this? Any comment will be appreciated,

    Thanks

    Pablo

    • Marked as answer by Mark.Rowe Thursday, September 3, 2009 8:45 PM
    Friday, May 23, 2008 11:26 PM

All replies

  •  

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1923441&SiteID=1

     

    Seems to be the opposite. Someone who needs to read the values from the wrapper.

    I need to Write to the wrapper.

     

    Tuesday, May 6, 2008 3:14 PM
  •  

    In R2 we don't support it out of box. You need to write custom pipeline component to workaround it.
    Wednesday, May 7, 2008 11:55 PM
  • Thank you very much!

    Thursday, May 8, 2008 2:19 AM
  • How I fixed this.

    I created a temporary OUt via MLLP and sent that to a new orchestration used the flat file schema creation then parsed out the NM109  and used a genaric map to through it to the GS08 segment.  Then I used that same flat file to generate the output pipeline.

     

    Monday, May 12, 2008 6:53 PM
  •  

    Greetings!

     

    In these days I have been experimenting an EDI Error regarding ISA12 (interchange control version number)

     

    Let me explain:

    When an incoming message has the following ISA Values, Biztalk is throwing an error regarding “Invalid versionId”

     

    ISA*04*SW426     *00*          *02*RRDC           *02*KCS            *080512*1247*U*00503*001651461*0*P*;~

    Error: 1 (Miscellaneous error)

       17: Invalid VersionId

    Error: 2 (Field level error)

       SegmentID: ISA

       Position in TS: 1

       Data Element ID: ISA12

       Position in Segment: 12

       Data Value: 00503

       7: Invalid code value

     

    I have created the corresponding parties and the messages are processed successfully as long as the messages have an ISA12 value prior to 00503.

    I was looking to modify the service extension schema (http://msdn.microsoft.com/en-us/library/bb246017.aspx) however the ISA12 is not available on that schema.

     

    I have not found a solution yet, so I have actually begun to create a Custom Pipeline Component and modify the EDI envelope in order to replace the ISA12 value for 00502 version. However I am getting the error: "Duplicate transaction set...."

     

    This is part of my custom code on decoder stage:


    public ... Execute(IPipelineContext pc, IBaseMessage inmsg)
    {

    IBaseMessagePart bodyPart = inmsg.BodyPart;
    Stream originalStream = bodyPart.GetOriginalDataStream();

    int numberBytesToRead = (int)originalStream.Length;
    int numberBytesRead = 0;

    byte[] outBytes = new byte[numberBytesToRead];

    int bytes = originalStream.Read(outBytes, numberBytesRead, numberBytesToRead);

    string outboundEDI = System.Text.Encoding.Default.GetString(outBytes);


    //Replace ISA12
    string [] splitEDI = outboundEDI.Split(new Char [] {'*'});
    if (splitEDI.Length > 0 && splitEDI[12] != null)
    {
          int controlVersion = System.Convert.ToInt32(splitEDI[12].ToString());
          if (502 < controlVersion)
          {
              outboundEDI = outboundEDI.Replace(splitEDI[12].ToString(),
    "000502");
          }
    }

    byte[] newEDIBytes =
    System.Text.Encoding.ASCII.GetBytes(outboundEDI.ToString());

    MemoryStream memStream = new MemoryStream();
    memStream.Write(newEDIBytes, 0, newEDIBytes.Length);
    memStream.Position = 0;

    bodyPart.Data = memStream;
    pc.ResourceTracker.AddResource(memStream);

    return inmsg;

    }

    Any of you know how to accomplish this? Any comment will be appreciated,

    Thanks

    Pablo

    • Marked as answer by Mark.Rowe Thursday, September 3, 2009 8:45 PM
    Friday, May 23, 2008 11:26 PM