Consuming Dataset in orchestration
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Consuming Dataset in orchestration




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Consuming Dataset in orchestration  
MHS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 07:47 AM

Hello,

I have a .net Assembly that returns a dataset. I created an instance of my
class in expression shape and assigned it to dataset variable.

in order to get the row count I am unable to write
dataset.tables[0].rows.count. It gives an error. More over I do not see
rows.count in context menu when I type dataset.tables[0].


I was hoping to get the row count and assign it to a variable and then use
loop shape to loop through and try to retrieve values from dataset rows by
incrementing index.

Can I do this?

Can anyone please suggest how can I make this to work?

Any help would be greatly appreciated.

Thanks
MHS






[ Post a follow-up to this message ]



    RE: Consuming Dataset in orchestration  
Matt Meleski


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-04 01:46 AM

MHS

One method you can use, is to create an .XSD schema in your BizTalk
Project, that represents the dataset that you have in your .net assembly.
1) If the you are using a strongly typed dataset, then you can copy the .xsd
file
from your .net assembly to your BizTalk assembly. If not, then you will
have to create the schema. I believe there is a method on the dataset to do
this (creating the schema from the dataset).
2) Now in your Orchestration you can create a message that represents the
BTS xsd schema.
3) In an expression shape you can then populate the BizTalk Message by
calling your .Net assembly.
4) Now you can use xpath in your message to get the total row count and loop
through the items in your message like below:

// In one expression shape get the total count :
orderItemCount = 1;
orderItemTotal = xpath(InComingOrder,"number (count (//OrderItems))");

// Usiing a Looping Shape (with a contained expression shape get specific
// attributes from the BizTalk Message that you are interested in, using xpa
th

currentAmount = xpath(InComingOrder,"string(//OrderItems[" +
strorderItemCount + "]//@Amount)");

// Increment the counter
orderItemCount = orderItemCount + 1;

// Your loop shape will have an expression like this:
orderItemCount <= orderItemTotal

Matt


"MHS" wrote:

> Hello,
>
> I have a .net Assembly that returns a dataset. I created an instance of my
> class in expression shape and assigned it to dataset variable.
>
> in order to get the row count I am unable to write
> dataset.tables[0].rows.count. It gives an error. More over I do not se
e
> rows.count in context menu when I type dataset.tables[0].
>
>
> I was hoping to get the row count and assign it to a variable and then use
> loop shape to loop through and try to retrieve values from dataset rows by
> incrementing index.
>
> Can I do this?
>
> Can anyone please suggest how can I make this to work?
>
> Any help would be greatly appreciated.
>
> Thanks
> MHS
>





[ Post a follow-up to this message ]



    RE: Consuming Dataset in orchestration  
Ben Cuttriss


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-05 10:52 PM

MHS.
I was looking into this (for messaging reasons from my data layer without
using the SQL Adapter) and I have finally figured it out.

I think the other answer you got was a bit misleading since you can't do
what he was saying (messages have to be constructed in construct block etc.
etc.)

Basically the steps are as follows:
1. Create the .Net assembly typed dataset.  This will generate your xsd as
well as the code behind that you can use.
2. Create a function (statuic is good) that calls and create the dataset.
eg:

****Start Example ****
public static string GetDataSet ()
{
System.Diagnostics.Debug.WriteLine("abc called");
string spName = "CustOrderHist";

Document bc = new Document();
string[] tableNames = new string[]{bc.CustOrderHist.TableName};

// Set up parameters
SqlParameter [] arParams =
SqlHelperParameterCache.GetSpParameterSet(@"Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data
Source=PC00516\PC00516_BENC;", spName);

arParams[0].Value = @"ALFKI";


SqlHelper.FillDataset(@"Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=Northwind;Data Source=PC00516\PC00516_BENC;",
spName, bc,tableNames, arParams);

System.Diagnostics.Debug.WriteLine(bc.GetXml());
return bc.GetXml();
}
****End Example*****

3. Now that this function returns a string (XML document representation) we
go to the orchestration.
4. Copy the schema from your .Net assembly to the Biztalk project.
(Rename the default namespace on the schema so it matches the one from your
.Net assembly (not sure if this is required...))
5. Create a variable of type XmlDocument.
6. Create an expression that sets the variable XmlDoc = class.GetDataSet
(from 2)
7. Now create a message of type schema that you copied from the .Net assembl
y
8. Create a construct block to create the message
9. You can set directly the message to the XmlDocument you created in 6.

Neat 'eh?
Hope this helps some more.  If it doesn't reply and I'll contact you
directly with some example code.
Regards
Ben Cuttriss





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:48 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register