none
promote or something else? RRS feed

  • Question

  • I am now working on routing the messages based on values in the 2010AA Billing provider name NM109 field.

    I need to see if the NPI coming in is in the table and if it is process through one orchestration and if not process through another.

    I tried to promote the NM109 field but it gave me an error saying...

    "This node can occur potentially multiple times in the instance document. Only nodes which are guaranteed to be unique can be promoted."

    So I guess this will not work the way I want it to... surprise... surprise~!

    Anyone tried something like this before? I guess I could use a scription functiod in the map and create a function that checks the db value but that seems kind of messy and I figured one of you would have a better suggestion.


    Thanks In Advance!
    Tuesday, April 14, 2009 8:20 PM

Answers

  • I figured it out... had to convert it to string. See below.

    NPI = xpath(Message_1,"string(/*[local-name()='X12_00401_837_P' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='TS837Q1_2000A_Loop' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='TS837Q1_2010AA_Loop' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='NM1_BillingProviderName_TS837Q1_2010AA' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='NM109__BillingProviderIdentifier' and namespace-uri()='']/text())");

    • Marked as answer by fsubob2004 Wednesday, April 15, 2009 7:53 PM
    Wednesday, April 15, 2009 7:53 PM

All replies

  • Could you just XPATH to it in your orchestration? NPI=xpath(inmsg,'/segment[1]/element[1]/text()') then route it based on the value of NPI? 
    Eric Stott [http://blog.biztalk-info.com] - Mark as Answer if this reply does.
    Tuesday, April 14, 2009 9:27 PM
  • Yes, that would be my first choice but my Xpath skills are lacking...

    Here is what I am currently doing in the Construct Message Shape.

    MessageHolder = IncomingMessage;

    NPI = xpath(MessageHolder,"/*[local-name()='X12_00401_837_P' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='TS837Q1_2000A_Loop' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='TS837Q1_2010AA_Loop' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='NM1_BillingProviderName_TS837Q1_2010AA' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='NM109__BillingProviderIdentifier' and namespace-uri()='']");

    BiztalkFunctions.MyGlobals.MyGlobalSourceFilename = NPI;

    MessageHolder is declared as System.XML.XMLDocument

    NPI is declared as System.String

    I just copied the xpath from the schema node properties.

    I am getting the following error through Biztalk Administrator when I run a file. It does not give me any errors when i build or deploy through VS.

    Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Bobby837.Orchestration_837P(b53ac9b0-abe3-be91-3dc2-2ff171bf3470)'.

    The service instance will remain suspended until administratively resumed or terminated.

    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.

    InstanceId: 51df3893-84d3-4f59-9b61-750d110db926

    Shape name: ConstructMessage_2

    ShapeId: 2e2cc029-45e6-4ab8-a0dc-0e5d70a49e58

    Exception thrown from: segment 1, progress 7

    Inner exception: Specified cast is not valid.

     

    Exception type: InvalidCastException

    Source: Microsoft.XLANGs.Engine

    Target Site: System.Object XPathLoad(Microsoft.XLANGs.Core.Part, System.String, System.Type)

    The following is a stack trace that identifies the location where the exception occured

    at Microsoft.XLANGs.Core.Part.XPathLoad(Part sourcePart, String xpath, Type dstType)

    at Bobby837.Orchestration_837P.segment1(StopConditions stopOn)

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

    Wednesday, April 15, 2009 1:10 PM
  • I figured it out... had to convert it to string. See below.

    NPI = xpath(Message_1,"string(/*[local-name()='X12_00401_837_P' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='TS837Q1_2000A_Loop' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='TS837Q1_2010AA_Loop' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='NM1_BillingProviderName_TS837Q1_2010AA' and namespace-uri()='http://schemas.microsoft.com/BizTalk/EDI/X12/2006']/*[local-name()='NM109__BillingProviderIdentifier' and namespace-uri()='']/text())");

    • Marked as answer by fsubob2004 Wednesday, April 15, 2009 7:53 PM
    Wednesday, April 15, 2009 7:53 PM