TN Flat File

Hi all

First time I am wrking on TN.

In my project, customer send the oreders in Flat File and EDI Flat File formats.These orders are first send to TN.For this purpose I created partner profile in TN.How to create document type,processing rules for EDI Flat File. I read TN User’s Guide, But i did’t understand that.

What type of services are used for this. In TN User’s guide they said Create GateWay Service.what is this GateWay Service, How to Create This service.

Any one pls help.

Regards
Ravi

Ravi,

Assuming you have the EDI module, please read that documentation as well.

Ravi,

Please use search in this site of respective sections,starting from EDI,Flatfile,TN basics flow steps etc…have been discussed in many threads.

Goodluck,

Hello,

I have relatively little experience using TN and I am attempting to process flat files using Trading Networks to log incoming files and pass the file along for processing using wM services. The problem I am experiencing is passing flat file data from a mainGateWay through Trading Networks and into a service for final processing. The file is recognized by the processing rules and the data is stored in ffdata on the transaction analysis screen in Trading Networks. The processing rule appears to be set up correctly and the service appears to execute but acts as though there is no data passed to it in either the content portion of Bizdoc or even ffdata.

I am using wm.tn.doc.ff:routeFlatFile to pass the data in to TN.

If I am missing something covered in the documentation please point me in the right direction.

webMethods/Trading Networks 6.1
Unix platform

Thank you in advance for any input

Stan

Stan,

I believe you are passing as stream in the routeFlatFile and as you said TN recognizes and triggers rule with the appropriate service then you should extract using the bizdoc/content(bytes)convert bytesToString(flatfiledata).So is content coming null?
what is ur processing service flow steps when TN submits the bizdoc?

HTH,
RMG

RMG,

Thank you for your response.

The bizdoc/content(bytes) is not null, the content is not null and looks like the content(bytes), see pipeline piece below.

<array>
<record>
<value>ffdata</value>
<value>text/plain; UTF8</value>
<number>467</number>
<byte>
UEJBUyAgICAyMDA1MDMzMDEzMzgwMDAwMDAwNTAwMDAwMDAwMDAwMDAwMDdLUEFNIFBCQV
MgIDIwMDQwMTE0MTEwMDAwYmMwMTIwMDQwMQoyMSAwMjAyMCAgICAgIDAwMzEyMTAwMDAw
MDAwOTBBMVMwMjA4NkQ0WDAwMDAwMDAwMDAwMDEwRjRMMDAwMDAwMDAwMDAwMDAwMTRZCj
IxIDAyMDIwICAwMDAwMDAzMDAwMDAwMDAwMDA5MEExUzAyMDg2RDRCMDAwMDAwMDAwMDAw
MjkgICAgICAgICAgICAgICAgIDAxNFkKMjEgMDIwMjAgICAgICAwMDMxMjEwMDAwMDAwMD
kwRDFTMDIwODZENFgwMDAwMDAwMDAwMDAzfUY0TDAwMDAwMDAwMDAwMDUwMDE0WTAwCjIx
IDA4MDIwICAwMDAwMDAzMDAwMDAwMDAwMDA5MEQxUzAyMDg2RDVDMDAwMDAwMDAwMDAxNH
1GNEwwMDAwMDAwMDAwMDA2SjAxNFkKMjEgMzIwMzEgICAgICAzNkQgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIEY0TDAwMDAwMDAwMDAwMDcwMDE0WQo= </byte>

To touble shoot my problem I creates two little services.

The first service will strictly read a file (getfile):

pub.file:getFile
MAP step for TN_parms (Hints)
wm.tn.doc.ff:routeFlatFile

The second service (envoked by TN) strictly writes the file content to a file on the server with the following steps:

pub.io:bytesToStream
pub.flatFile:convertToString
DCD_B_PUBLIC.utilities:writeToFile

Stan

The first service will strictly read a file (getfile):

pub.file:getFile(loadAs-stream)then map it to ffdata
MAP step set these under TN_parms
–DoctypeName,SenderID,ReceiverID
wm.tn.doc.ff:routeFlatFile(map ffdata) this will routes to TN successfully

The second service (envoked by TN) strictly writes the file content to a file on the server with the following steps:

extract the bizdoc/content(bytes)from the pipeline record bizdoc
pub.io:bytesToStream
pub.flatFile:convertToString
DCD_B_PUBLIC.utilities:writeToFile

The above 2flows snippets will work for trouble shooting.

HTH,
RMG

RMG,

Thanks for verifying the two snippets should work.

I did check that I was following the steps (getfile - loadas-stream, mapping DoctypeName,SenderID,ReceiverID etc)and I write out a 0 byte file when I run the flows. I can see the data sitting on the content tab in the transation analysis of TN.

When I combine the two snippets as one wM flow (taking out the TN pieces) I actually get data my output file. I figure it must be something simple that I am missing I just don’t know what it is…

Stan

Stan,

Sorry,i am not really sure what could be the rootcause since you have all the setup inplace for tracing it.But if you try to debug more you should get the desired results.

If i have any clue will post it.

what you did for taking out the TN pieces?

HTH,
RMG

RMG,

If I understand what your asking in the last sentence. I disabled the wm.tn.doc.ff:routeFlatFile and invoked a call to the second flow (second snippet) in the second flow I disabled the pub.io:bytesToStream and just made sure the ffdata was connected up in the pub.flatFile:convertToString. When it runs I get a populated output file.

Thanks for letting me bounce the problem off of you and your feedback, I will check back occasionally over the next couple of days or so incase you or any one else posts any suggestions.

Stan

Stan,

I think this is what you have to do for make it work,

Just to get clarify,So are you mapping bizdoc/content(bytes)to the convertToString?This will not work…Actually you have to map bytes to convertToValues (for parsing) and then map the data to target format.

PS:convertToString will take only ffValues(IDATA document)and creates flatfile string for outbound.

But if your requirement is just store the flatfile that is coming to TN then just use bytesToString(flatfile)and write to a file as required.

HTH,
RMG

RMG,

Just saw your last posting. I have been working through the problem. I did not put it in my previous posting but I did have a convertToValues in my flow

pub.io:bytesToStream
pub.flatFile:convertToValues (with a ffSchema assigned)
pub.flatFile:convertToString
DCD_B_PUBLIC.utilities:writeToFile

The problem actually seems to be with the pub.flatFile:convertToValues step.

I convert the bytesToStream then read the stream into the convertToValues. If I remove the convertToValues and read the stream into the convertToString then write the file I can write out the file without error.

Ultimately I will need to work with the data, not just write it out for storage. I only created the two flows for trouble shooting I plan to incorporate the steps to use TN into some existing wM services and postion TN to take over some functionality that is being done by a another process we use to log files and keep track of processing.

Please update us if the issue was resolved after debugging.

Please dont hesitate to ask if you have any problems/missing in the flow steps etc…

Sorry if i am not much helpful.

HTH,
RMG

RMG,

Your help has been appreciated, it got me moving in the right direction.
I expect to resolve the issue before much longer and I will post an update at that point.

Thanks again for the help.

Stan

Hi RMG,

I have gone through the post. I had a similar problem and indeed i have solved it. I had to pass a flatfile to TN thru the gateway service and have used :
pub.file.getFile
pub.flatfile.convertToValues
pub.io:bytesToStream
wm.tn.doc.ff:routeFlatFile
and set the TN_parms also.

But when i tried using tn.receive instead of routeFlatFile the service failed. What is the basic difference between the two services and why can i use it in gateway service.

regards,
sumit

Sumit,

For routing flatfiles in IS/TN6.x you have to use WmTN routeFlatFile service,the difference is tn:receive uses bytes object and routeFlatFile uses stream object and then only TN recognizes based on the flatfile vs xml contenttype.

HTH,
RMG.

Thanks RMG.
but if we use :
pub.file.getFile
pub.flatfile.convertToValues
tn:receive
set the TN_parms also.

Then wont it work?
I hope i am going in correct direction.