none
Calling EDI Send Pipeline within an Orchestration RRS feed

  • Question

  • Hi,

     

    I have an orchestration which is trying to send EDI files using a dynamic send port.

     

    I have been trying, with no success, to call the "Microsoft.BizTalk.Edi.DefaultPipelines.EdiSend" from within my orchestration, as follows:

     

    First I map to EDI 850, and set the following context property:

     

    Msg_EDI850(EDI.DestinationPartyName) = thePartyName;

     

    Then:

     

    Code Snippet inside a Message Assignment Shape

    //Initialize pipeline output
    XmlDoc = null;

     

    //OutputPipeline is a variable of type

    //"Microsoft.XLANGs.Pipeline.SendPipelineInputMessages"

     

    //Add the EDI850 message
    OutputPipeline.Add(Msg_EDI850);

     

    //Call the Edi Send Pipeline and store result in XmlDoc

    Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(typeof(Microsoft.BizTalk.Edi.DefaultPipelines.EdiSend)
    ,OutputPipeline,XmlDoc);

     

    Whenever I try, I get the following exception in the Error Log:

     

    There was a failure executing pipeline "Microsoft.BizTalk.Edi.DefaultPipelines.EdiSend". Error details: "Error in serialization. Message does not contain SendPort property".

     

    Is calling the Edi Send Pipeline from within the orchestration supported? Any suggestion?

     

    I need to call the pipeline within the orchestration as I am trying to further manipulate the message before it goes out.

     

    I would appreciate any help or suggestion on this.

     

    Thanks,

     

    -- Steve

     


     

    Thursday, May 3, 2007 9:35 PM

Answers

  • Running the EDISend pipeline from an orchestration is not supported in R2.  We are tracking this for the future, but had higher priority items to address for this release.

     

    I would suggest one of two approaches:

    • a post-processing pipeline component which performs the manipulation that you need to occur after serialization
    • using a loopback port. Basically, use a send port with that pipeline into an MSMQ or file location and a receive location with a pass through pipeline back into the orchestration.
    Friday, May 4, 2007 6:41 PM

All replies

  • Running the EDISend pipeline from an orchestration is not supported in R2.  We are tracking this for the future, but had higher priority items to address for this release.

     

    I would suggest one of two approaches:

    • a post-processing pipeline component which performs the manipulation that you need to occur after serialization
    • using a loopback port. Basically, use a send port with that pipeline into an MSMQ or file location and a receive location with a pass through pipeline back into the orchestration.
    Friday, May 4, 2007 6:41 PM
  • I have implemented this after discovering that same issue mentioned above. My solution, I would like to think, is more elegant, and perhaps more effiecient than those mentioned here.

    I created a helper class that recieves the three parameters and implements the logic for the Send pipeline execution. the sig is as follows:

    public Microsoft.XLANGs.BaseTypes.XLANGMessage ConvertXMLtoANSI(Microsoft.XLANGs.BaseTypes.XLANGMessage InboundMsginXML, Microsoft.XLANGs.BaseTypes.XLANGMessage OutMsgANSI, Type TypeOfPipeLine)

     

    The logic is as follows:

    Microsoft.XLANGs.Pipeline.SendPipelineInputMessages _EDIPipeLine = new Microsoft.XLANGs.Pipeline.SendPipelineInputMessages();

    _EDIPipeLine.Add(InboundMsginXML);

    Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(TypeOfPipeLine, _CovastPipeLine, OutMsgANSI);

    return OutMsgANSI;

     

    Thats it....

     

    now, there is an issue I am currently investigating; if you try to invoke this method more than once in the same program scope, the pipeline only receives the first message passed to it.

    So, to create an ANSI 837 and an 835 file is currently not possible.

    • Proposed as answer by CALlanoR Monday, October 5, 2009 7:59 PM
    Sunday, August 10, 2008 2:12 AM
  • Hi Phoeniixxm,

     

    I have tried you solution, but continues to get the "Message does not contain SendPort property" Error.

    Is your solution only for Covast since you have a variable name of _CovastPipeLine? (Which is privoius defined as _EDIPipeLine.

     

    Best Regards

    Paw

    Monday, November 3, 2008 4:29 PM
  •  

    it is not exclusive to Covast, but rather works with any pipeline. If you need a sendport property, why dont you assign it to the output message (the one that will hold the result of the pipeline) before calling the helper class, or before invoking the pipeline.

     

    Now, bear in mind, alot of third party pipeline components do require this field for CACHING purposes and may not produce the message properly. I use a GUID as the send port name in those cases, otherwise, i just type in something like 'IntraOrchestrationSendPORT'

     

     

    Monday, November 3, 2008 4:34 PM
  • Hi Phoeniixx,

     

    Thanks for your quick reply.

     

    I have now tried to promote the follwoing properties:

    msgOut(BTS.AckSendPortName)

    msgOut(BTS.PartnerPort)

    msgOut(BTS.SPName)

    msgOut(BTS.SPID)

    msgOut(MessageTracking.PortName)

     

    but without any luck. My problem is I don't know exactly what property is required by the 2006 R2 BizTalk pipeline component. The full error message is:

     

    Error in Dynamic Mapping Orchestration. Exception:

    <br>Microsoft.XLANGs.Pipeline.XLANGPipelineManagerException: There was a failure executing pipeline "EdifactPipelines.Send_Edifact". Error details: "Error in serialization. Message does not contain SendPort property". ---> System.ApplicationException: Error in serialization. Message does not contain SendPort property

    at Microsoft.BizTalk.Edi.Pipelines.EdiAssembler.AddDocument(IPipelineContext pc, IBaseMessage inMsg)

    at Microsoft.BizTalk.Internal.ComponentWrapper.AddDocument(IPipelineContext pc, IBaseMessage inmsg)

    at Microsoft.BizTalk.PipelineOM.AssemblerComponent.AddDocument(IPipelineContext pipelineContext, IBaseMessage message)

    at Microsoft.BizTalk.PipelineOM.AssemblingSerializerStage.Assemble(IBTMPipelineContext pc, ArrayList messages, Int32 asmStageIndex)

    at Microsoft.BizTalk.PipelineOM.SendPipeline.Execute(IBTMMessageSet messageSet)

    at Microsoft.BizTalk.PipelineOM.PipelineManager.ExecuteSendPipeline(SendPipeline sendPipeline, IBTMMessageSet messageSet, Object interceptor, Stream perInstanceCofigStrm, Object transaction, IPipelineContext pBTMPipeCtx)

    at Microsoft.BizTalk.PipelineOM.PipelineManager.ExecuteSendPipeline(SendPipeline sendPipeline, IBTMMessageSet messageSet, IResourceTracker& rt)

    at Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecutePipeline(SendPipeline p, SendPipelineInputMessages inMessages, XLANGMessage outMsg)

    --- End of inner exception stack trace ---

    at Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecutePipeline(SendPipeline p, SendPipelineInputMessages inMessages, XLANGMessage outMsg)

    at Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(Type sendPipelineType, SendPipelineInputMessages inMessages, XLANGMessage outXLANGMsg)

    at dk.lemu.biztalk.utilities.OrchestrationHelper.ConvertXMLtoANSI(XLANGMessage InboundMsginXML, XLANGMessage OutMsgANSI, Type TypeOfPipeLine)

    at LEMU_DynamicMapping.Orch_DynamicMapping.segment5(StopConditions stopOn)

    at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

     

    Any ideas on what I need to promote would be apreciated.

     

    Best Regards

    Paw

    Tuesday, November 4, 2008 8:47 AM
  • Hi,

    I am trying to call a custom edi receive pipeline from iside the orchestartion using the follwoing line of code..

     

    RcvPipeOutput = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(typeof(CustPipeline_DecoderOrch.POC_PP277_RCVpipeline),InputMsg);

     

     

    i am getting the following error in the eventlogs

     

    Pipeline CustPipeline_DecoderOrch.POC_PP277_RCVpipeline is not supported when executed from an orchestration. This may be due to one of the following reasons:

    1) It is doing Recoverable interchange processing;

    2) It is setting MessageDestination=SuspendQueue on the message context;

    3) It is setting SuspendOnRoutingFailure=true on the message context.

     

    Can you please help me in resolving the issue.. i know that calling edi send pipelines from orchestration is not supported in BTS 2006 R2..but i am not sure is it the same case for receive pipeline also..

     

    Pls help me

    Regards,

    Ravibabu

    Monday, November 17, 2008 4:38 PM
  • Hi Paw... Please let me know if you were able to resolve this issue.. Currently I am also facing this...

     

    Thanks..

    Tuesday, December 2, 2008 2:50 PM
  • Hi, Unfortunately I didn't find a solution to this, so I had to use a workaround with sending it out on a fysical port and corrolating it back into the orchestration again as a EDI flat file based on the filename.

     

    Best Regards

    Paw

     

    Tuesday, December 2, 2008 3:17 PM
  • Thanks Paw for your quick response...

     

    Wednesday, December 3, 2008 5:45 AM
  • You have to set the sendport name, I used a GUID

    Msg_EDI850(BTS.SPName) = System.Convert.ToString(System.Guid.NewGuid());

    my Raw EDI encoded output message is of type System.Xml.XmlDocument

    the input file is the edi Schema provided by microsoft, so in your case X12_00401_850 (or similar)

    FlatFileX12_270 = null;
    Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(
        typeof(Microsoft.BizTalk.Edi.DefaultPipelines.EdiSend),
        SendPipelineInput,
        FlatFileX12_270
    );

    Decompiling the edi assembler (Microsoft.BizTalk.Edi.Pipelines.EdiAssembler) shows the following where i think the error is occuring.

    public void AddDocument(IPipelineContext pContext, IBaseMessage pInMsg)
        {
            Trace.Tracer.TraceMessage(0x40, "EDI Assembler:AddDocument entered.");
            if (pInMsg == null)
            {
                throw new EdiException(StringResources.GetString("NullMessagePassedToEdiAssembler"));
            }
            object obj2 = pInMsg.Context.Read("ReuseEnvelope_EdiEncoded", "http://schemas.microsoft.com/Edi/PropertySchema");
            if (obj2 is bool)
            {
                this.mIsPassThru = (bool) obj2;
            }
            if (this.mIsPassThru)
            {
                this.mPassThruMsg = pInMsg;
            }
            else
            {
                string str = HelperMethods.RetrieveDocType(pInMsg);
                if (Helper.IsEmpty(str))
                {
                    throw new EdiException("docType");
                }
                this.mAssembler = AssemblerFactory.CreateAssembler(str);
                if (this.mAssembler == null)
                {
                    throw new EdiException("Unrecognized message type");
                }
                string str2 = pInMsg.Context.Read("SPName", "http://schemas.microsoft.com/BizTalk/2003/system-properties") as string;
                if (Helper.IsEmpty(str2))
                {
                    throw new EdiException(StringResources.GetString("SendPortPropertyIsAbsent"));
                }
                this.mAssembler.AddDocument(this, pContext, pInMsg, str, str2);
                Trace.Tracer.TraceMessage(0x40, "EDI Assembler:AddDocument exited.");
            }
        }

    • Edited by Patrick r Huber Tuesday, November 2, 2010 5:12 PM Update of message descriptions.
    • Proposed as answer by _Matthew Tuesday, May 24, 2016 10:08 AM
    Tuesday, November 2, 2010 5:06 PM
  • Thx Patrick, I've had the same issue, and your analysis and solution are correct :)


    Matthew.

    Tuesday, May 24, 2016 10:09 AM