How to Debatch into an orchestration with a pipeline

This is a frequent problem, and many solutions exist. But I will explain the solution with a pipeline which is more effecient than the solution with xpath solution

Here is my case, I receive data from Oracle DataBase with WCF-Oracle adapter and I need to process line per line.

WCF-Oracle work in my case in Receive-Response behavior so I need to develop an orchestration and debatch within.

Creating the schema and the envelop

First I create the schema using the Visual Studio wizzard :

The next step is creating the envelop :

  • Create a new schema
  • select the <schema> node and select imports options :
  • Add the Oracle schemas
  • Set « IsEnvelop » property to true
  • Now Create a node and for data structure type select the one which start by arrayOf in my case I chose ArrayOfPOLLINGSTMTRECORD
  • It will create a sub node, normaly this subnode have a « max occurs » set to « unbounded« 
  • Select the root node, copy the « Instance xpath » property value and paste it  in « Body Xpath » property

Creating the orchestration

    • In your solution create a new receive pipeline and drag an XML Disassembler
    • Then add an assembly reference to Microsoft.XLANGs.Pipeline
    • Now create your orchestration with your receive send port
    • Create your message request and response
    • Create another message : msgExportLine type : XmlDocument
    • Next drag a transform shape and apply it on your received schema into to your envelop :
    • Drag a new Scope call it DebatchScope  set « atomic » to « Transaction Type« 
    • In DebatchScope add a new variable, name it InputPipeline and select Microsoft.XLANGs.Pipeline.ReceivePipelineOutputMessages for the type
    • Drag an expression shape and set to :
      InputPipeline = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline
      (typeof(MyProject.Pipelines.rpDebatch),msgEnveloppe);(Replace MyProject by your project Namespace)

      
      

       

  • Add a loop shape with this condition :
    InputPipeline.MoveNext()

    
    
  • Add an assignement shape and set :
  • msgExportLine = new System.Xml.XmlDocument();
    InputPipeline.GetCurrent(msgExportLine);

    
    

    And now you’ve got only one line into MsgExportLine, You can put it in a pivot format, or if you prefer you change XmlDocument by the unit type document

Publicités

Une réflexion sur “How to Debatch into an orchestration with a pipeline

Laisser un commentaire

Choisissez une méthode de connexion pour poster votre commentaire:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s