none
BizTalk Xpath how to extract range "Postion () > valu1 and position() < value2 " in Biztalk xpath

    Question

  • BizTalk Xpath : how to extract range of nodes using "Postion () > valu1 and position() < value2 " in Biztalk xpath?

    position () = value1 works fine..its only when I try to extract range of  xml nodes using the above xpath but  I get below error. Any help would be appreciated. 

    Error Message:

    System.NotSupportedException: Specified method is not supported.


       at Microsoft.XLANGs.Core.Part.GenericLoadFrom(Object source)

       at Microsoft.XLANGs.Core.XSDPart.ProtectedLoadFrom(Object source)

       at Microsoft.XLANGs.Core.Part.LoadFrom(Object source)

       at Microsoft.XLANGs.Core.Part.XPathAssign(Part sourcePart, String xpath)

       at PwC.Middleware.TalentLink.ProcessToTalentLink.Orchestrations.ProcessBookings_Bulkupload.segment2(StopConditions stopOn)

       at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
    System.NotSupportedException
    Scoped@
    ProcessBookings_Bulkupload.??__scope33
    ProcessBookings_Bulkupload.ProcessBookings_Bulkupload
    1e72226d-3c7c-474a-bf36-836dafabf014


    Friday, September 22, 2017 8:34 PM

All replies

  • How are you trying to extract the nodes?

    What is the xpath u r trying ?

    I would opt for a map and create a new similar message . In the map xslt you loop for the range only and get all the required nodes mapped in output.


    Pi_xel_xar

    Blog: My Blog

    BizTalkApplicationDeploymentTool: BizTalk Application Deployment Tool/

    Friday, September 22, 2017 8:37 PM
    Answerer
  • Here is my requirements ,

    1) I receive the below format from my source system.

    <Emps>
    <Emp><ID>111</ID><Status>New</Status></Emp>
    <Emp><ID>222</ID><Status>New</Status></Emp>
    <Emp><ID>333</ID><Status>New</Status></Emp>
    <Emp><ID>444</ID><Status>New</Status></Emp>
    <Emp><ID>555</ID><Status>New</Status></Emp>
    <Emp><ID>666</ID><Status>New</Status></Emp>
    </Emps>

    2) I have to split the source message into a batch of maximum size, say in this scenario maximum batch size is 3 so I have to split the message into two.  

    <Emps>
    <Emp><ID>111</ID><Status>New</Status></Emp>
    <Emp><ID>222</ID><Status>New</Status></Emp>
    <Emp><ID>333</ID><Status>New</Status></Emp>
    </Emps>
    
    <Emps>
    <Emp><ID>444</ID><Status>New</Status></Emp>
    <Emp><ID>555</ID><Status>New</Status></Emp>
    <Emp><ID>666</ID><Status>New</Status></Emp>
    </Emps>

    3) Next each batch message need to send to destination system using solicit response port and get the response 

    and update the status back to the source message based on response message. Say in this scenario for two request message individual response would look like this.

    <Results>
    <success>
    <ID>111</ID>
    <ID>222</ID>
    </success>
    <failure>
    <ID>333</ID>
    </failure>
    </Results>
    
    
    <Results>
    <success>
    <ID>444</ID>
    <ID>555</ID>
    <ID>666</ID>
    </success>
    <failure>
    </failure>
    </Results>

    4) And finally my output should look like this. 

    <Emps>
    <Emp><ID>111</ID><Status>successful</Status></Emp>
    <Emp><ID>222</ID><Status>successful</Status></Emp>
    <Emp><ID>333</ID><Status>failed</Status></Emp>
    <Emp><ID>444</ID><Status>successful</Status></Emp>
    <Emp><ID>555</ID><Status>successful</Status></Emp>
    <Emp><ID>666</ID><Status>successful</Status></Emp>
    </Emps>

    So I was looking for xpath using which I can extract range(based on maximum batch size) of xml record instead of extracting 1 by 1 using xpath position() = loopCounter value and assembling them based on maximum batch size.

     



    • Edited by SubrataSaha Saturday, September 23, 2017 1:38 AM
    Saturday, September 23, 2017 1:34 AM
  • Its basically scatter gather what you are trying to achieve.

    https://prashantbiztalkblogs.wordpress.com/2015/03/05/implementing-scatter-gather-pattern-in-biztalk-using-self-correlation/


    Pi_xel_xar

    Blog: My Blog

    BizTalkApplicationDeploymentTool: BizTalk Application Deployment Tool/

    Saturday, September 23, 2017 6:16 AM
    Answerer
  • Debatch into single messages using an envelope schema and batch into what number you prefer
    No looping to extract messages is needed 

    Debatching, eg
    https://social.technet.microsoft.com/wiki/contents/articles/26005.biztalk-server-debatch-xml-with-envelope.aspx

    /Peter

    Saturday, September 23, 2017 7:55 AM
  • @Pi_xel_xar, Yes I am aware of Scatter gather mechanism, but all I am looking for how to scatter in a more than one message in a batch instead of straight way disassembling each record into individual message.  I think there  is way to disassemble based on maximum batch size using custom pipeline component, but I just trying to avoid writing extra code to keep my integration simple so I was looking to use xpath using which if I can straight way scatter number of records I can extract.

    If I just simply use built in disassemble pipeline component the I have to assemble again to construct maximum batch/record per message. 

    Also I am not sure if there is any drawback of using scatter gather since there is correlation involved, I am just afraid of zombie message which cause due to correlation(Not sure in this scenario if anyone has faced).   How do handle if there is any exception raised in child orchestration how slef correlation receive will be handled in that case.


     

     

    • Edited by SubrataSaha Sunday, September 24, 2017 4:45 PM
    Sunday, September 24, 2017 4:29 PM
  • I have only seen zombies in orchestration with timers and loops involved
    Batching on number of files (with correlation) shouldn't cause problems afaik

    /Peter

    Sunday, September 24, 2017 6:37 PM