none
How to override headers in Output Batched EDI files. RRS feed

  • Question

  • Hi,

    I visit many articles but failed to achieve OutPut. Want to Override EDI Headers GS02 and GS08 value.
    In my Knowledge ,we can change it via Orchestration and Pipeline as well.
    But in my case I am using Batching Orchestration so Orchestration level overriding ll not give the desired OutPut.
    I created a small Pipeline component which Promote EDIOverrideHeader and GS02 ,GS08 value in output msg but my output is not having Override value.

    Code is :-

     public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties)
            {
                object val = (object)GS02_val;
                propertyBag.Write("OverrideGS02", ref val);
    
                object val1 = (object)GS08_val;
                propertyBag.Write("OverrideGS08", ref val);
    
            }
    
            #endregion
    
    
    
              public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
            {
                  System.Diagnostics.EventLog.WriteEntry("Execute","started");
                pInMsg.Context.Promote("OverrideEDIHeader", "http://schemas.microsoft.com/BizTalk/2006/edi-properties", true);
                pInMsg.Context.Promote("GS02", "http://schemas.microsoft.com/BizTalk/2006/edi-properties", GS02_val);
                pInMsg.Context.Promote("GS08", "http://schemas.microsoft.com/BizTalk/2006/edi-properties", GS08_val);
    
                return pInMsg;
            }

    Placed this component before EDI assembler component in Send Pipeline.

    But didn't get desired Output.



    Friday, May 27, 2016 8:57 AM

Answers

  • What you trying to do is absolutely 100% supported and works just fine.  I've done it many, many times.

    First, disable the Fallback Settings, they can easily get in the way.  You may then get another error indicating the actual config problem.

    Make sure none of the specific transaction lines have Default checked.  This is easy to miss and can confuse the Assembler.

    Also, just FYI, they transactions are typically referred to as I, P and D.  No one uses the industry code as it's easy to confuse with other first class transactions.

    Monday, May 30, 2016 3:36 PM
  • Yes, you should have at least 4 rows.  1 Default, then I, P and D.

    It chooses the row by Transaction Type, 837_P for example, and Target Namespace*.

    *Suggestion on this, it's best to change the Target Namespace of the EDI Schemas to one you own, rather than the default Microsoft.  It works fine with the default, but using you own is better.

    Monday, May 30, 2016 5:03 PM

All replies

  • https://msdn.microsoft.com/en-us/library/dd210685.aspx

    Infact, for a batched message, setting GS02 and GS08 is not supported-

    atch transaction set published by the batching orchestration or Batch-in-Batch-Out transaction set published by the EDI Receive pipeline

    • All ISAs

    • GS04

    • GS05

    • GenerateUNA

    • All UNAs

    • All UNBs

    • GenerateUNG

    • UNG4.1

    • UNG4.2


    Thanks Arindam



    Friday, May 27, 2016 9:04 AM
  • How can i check Context Properties if Instance has completed, And yes i replace Promote method with Write and still i didn't get the Override values.




    Friday, May 27, 2016 10:23 AM
  • Hi Anurag

    You have to enable tracking for your SendPort - Track Message Properties. Once done, you should be able to see your completed Instances from Admin console.

    Note: your scenario is not supported as noted above.


    Thanks Arindam

    Friday, May 27, 2016 10:28 AM
  • So, is there any other way to do this except to write program.



    Friday, May 27, 2016 10:44 AM
  • Hold on, before we can give you advice, please answer some questions.

    Why can't you set the GS values in the Agreement per transaction?  GS is already fully configurable.

    Why do you need to change the GS values programmatically?  What problem are you trying to over come?  Business or technical.

    Because the Interchange (ISA...IEA) is already formed by the Batching Service and can contain multiple Functional Groups (GS...GE), EDIOverride is not supported.

    Now, there are ways around this but we need to know why you're trying to do this in the first place.

    Friday, May 27, 2016 12:26 PM
  • Hi john,

    Business User need three transaction files with same sender and receiver id so , BizTalk do not handle more then one envelope with same version , transaction Type  (837)  and namespace.
    In my Case BizTalk do not support PACDR schemas, so we are using 837 as transaction type in all of three PACDR transaction (298,299,300). 

    If i defined multiple envelopes so values should be :

    for 298 => GS01 : HC ,GS08 : 005010X298

    for 299 => GS01 : HC ,GS08 : 005010X299

    for 300 => GS01 : HC ,GS08 : 005010X300

    In this setup always 1st envelopes being populated every-time either i ll drop 298 file or 299 ,300.

     



    Monday, May 30, 2016 9:24 AM
  • What you trying to do is absolutely 100% supported and works just fine.  I've done it many, many times.

    First, disable the Fallback Settings, they can easily get in the way.  You may then get another error indicating the actual config problem.

    Make sure none of the specific transaction lines have Default checked.  This is easy to miss and can confuse the Assembler.

    Also, just FYI, they transactions are typically referred to as I, P and D.  No one uses the industry code as it's easy to confuse with other first class transactions.

    Monday, May 30, 2016 3:36 PM
  • Hi John,

    As you know by default a row is populated when we create agreement with BTS_Sender and BTS_Receiver.
    So,As i understand your text that i need to specify another 3 envelopes besides default row.

    And am little bit confused in the process of how biz-talk choose correct envelopes.
    Does it determine based on ST01 (Transaction Type) value?
    Can you elaborate or give me any link to clear my doubts?



    Monday, May 30, 2016 4:34 PM
  • Yes, you should have at least 4 rows.  1 Default, then I, P and D.

    It chooses the row by Transaction Type, 837_P for example, and Target Namespace*.

    *Suggestion on this, it's best to change the Target Namespace of the EDI Schemas to one you own, rather than the default Microsoft.  It works fine with the default, but using you own is better.

    Monday, May 30, 2016 5:03 PM
  • got your point.



    Monday, May 30, 2016 5:06 PM
  • Thank You John, 

    I have desired output by the step you provided above.



    Tuesday, May 31, 2016 11:03 AM