Forum Replies Created
-
AuthorPosts
-
July 24, 2006 at 9:12 PM in reply to: Help – Entering multiple child records using sql adapter #15102
promote the foreign key value in your schema for table 2. you will then need to loop each time for that message and insert the foreign key so that SQL knows who the parent is.
now, as i am not 100% sure of your situation let me give you a broad heads up on what i am saying.
each sql adapter schema is bound to one table (typically) so in other words, think of it as an insert statement in sql. Insert into foo (boo,bla) values (a,b) scope_identity;
you would then take the resulting primary key and insert that into the children tables as many times as they occur
insert into foochild (blah,blah,foo_fk) values (a,b,oldkey);you are either not looping on the children (hence only the top child gets inserted) or you are feeding this schema in to insert to two tables (sort of like appending the insert statements) and hence will only insert the parent and first child.
solution:
create a map that breaks out the children. basically loop on that child structure (<OutputValues>) and creates a whole new message for that data. of course, add the foreign key and feed it to the sql adapter. That will get all the children into the db….
translating that into C# methodology :
nodelist A = xdoc.selectnodes(‘\\\\outputvalues);
foreach(node x in A)
//extract node data, create sql statement and shoot to your db…return;
now this can be put in an expression shape straight away, or into an external C# dll that is called from an expression (my preference for the power of a C# class file compared to an expression) or doing it using biztalk orchestration shapes (also a great solution, but sql adapters in biztalk are still weak in my opinion).
hope this helps and feel free to ask me again if it doesnt
Thanks prodigy… Do you know any example project, to download and have a guide?… I’m new in biztalk!
why dont you parse the file in and have a map go through each line, evaluate whether or not its correct and map it accordingly.
use a script functiod that returns a bool and feed it into a value map shape. now feed this line as well to the value map shape. be sure to take the bool output of your script to the node itself for the good lines and invert it to the bad lines.. this will supress the empty nodes.
Here’s the bird’s eye view. I have a single Receive Location. This is a File Transport Type using the CovastEDIReceivePipeline. In this location is dropped an EDI 811 file. We are processing 811 documents for multiple customers so the Recipients can be multiple. I have been trying to get this to work with just one Recipient, but there will be more.
An Orchestration calls a Mapping which converts this document to XML. The XML is sent to a Send Port, which is another File Transport Type using the XML Transmit Send Pipeline.
Once the file is dropped in the Send Port it is processed by a windows service that imports it into a database.
Awsome reply.
I’ll give your suggestions a try and let you know how it goes.
Thanks,
–StevenThe map wont do validation but the pipeline should. I recall that this would through a messaging error into the msgbox.
now when you test, it may not throw an error if you have output validation turned off… go to the .btm file in your solution and go to properties, (where you would specify the test instance file and type) and make sure that you have output validation turned on…. BUT it may still output a file with the faulty data but will have an error in our output box in VS.
go ahead and deploy your solution and give it a shot… i may be totally off.
How can I return an uppcase value, last name for example, using the database lookup functoid? I’ve tried preceeding the the column name parameter with upper and toupper with no success.
Thanks
ok… forget about biztalk for a minute.
lets talk covast…all this is done through the covast pipeline component, covast envelope or through context properties of the file.
yes, you dont need a recipient address IFF covast can find it elsewhere. that is, in the envelope (if it originates as an XML) or in the context, if you are doing it dynamically.
That way, in your pipeline configuration, leave the recipient URI blank and just set the sender.
Mind you, you do need to have all the parties configured. I suggest using the Covast administration to add parties and party aliases. I personally have a recipient party for each business application. within these, i have different aliases for each trading party. Within that, you can define the particular element delimiter (in your case its not default(*) its ~) but also the document you want ( an 811 in your case )
If you could, send me the scenario that you are trying to do in particular. you seem to be recieving an EDI file, in which you are configured as several recipients (??) are you then routing them along or saving them somewhere? if you could post a birds eye view of the scenario it would be very helpful
Hello and thanks for your assistance.
I have 2 schemas, one is a normal xsd schema and the second is a flat-file \”|\” character delimited.
Schema1:
Order
-> FirstName (attribute)
-> Lastname (attribute)
-> LineItems (child record)
-> -> LineItem (child record)
-> -> -> ProductId (attribute)
-> -> -> Quantity (attribute)Schema2: Flat-File, Pipe character delimited
Root
-> FirstName
-> LastName
-> ProductId
-> Quantity* An Order can have multiple LineItems.
What I need to do is for each lineitem map a new record in the Flat-File Schema.I thought that i would be able to just add a looping functoid from Schema1->Order->LineItems to Schema2->Root record and for each record in the LineItems it would create a new record in Schema2, but this does not work.
For Example: If thier is 2 lineItems in Schema1 I need Schema2 to look like this:
firstName|lastName|item_1|quantity_1
firstName|lastName|item_2|quantity_2Does anyone have any suggestions to help me out with this.
Thanks,
–StevenI did get it working by creating a simple orch that does a receive/map/send.
[quote:5dda000740]I’m just curious. What’s the reason you are mapping to an Envelope Schema? [/quote:5dda000740]
We receive a file in a rather odd XML format from a vendor.
So the first XSLT turns it into the data we want, but still in one big batch.
Our batch schema is basically a wrapper for one of our existing schemas.Then we use the envelope schema to debatch it (no orch).
The proper thing to do is to code this in the orchestration.
Wrap the receive with a \”Listen\” shape, and in the other branch of the listen, add a Delay shape, set to the appropriate number of days/hours/minnutes. If the delay happens before the receive, that branch will run, and you can softly end the orchestration, or terminate it with an error.Please install the .NET connector from SAP before attempting to install the adaptor. The adaptor uses the .NET connector from SAP (not sistributed along with the adaptor)
Thanks
GuruI got past the problem by regenerating the schemas on the deployment machine and then redeploying. This is a Covast thing where the schema has to match what is in the database. I still haven’t figured out how to deploy without having to have VS.Net on the BizTalk server.
I see an other solution!
On mapping feed a scripting functoid with the field. then you can see if the stringlenght is lower than 10 (with C# code), if it is.. returns the string if it’s not, return \”Error\” or whatever!maybe a hardware problem?
Run memtest86 (you’ll need a good old floppy disk), and do a complete passage and see if no errors show up!
-
AuthorPosts