How to access ISA when processing Transaction content

We have a processing rule for an X12 4010 810 document. It’s “Action” is to “exectute a service” called “receiveInvoice”. In the “receiveInvoice” Flow service, I do the following:

 
SEQUENCE (Exit on Success) 
  SEQUENCE (Exit on Failure) 
    getTspace (Pulls out the Transaction content) 
    convertToValues (Creates an 810 IDATA document from the edidata) 
    mapInvoice (maps Invoice to an internal format) 
  SEQUENCE (Exit on Done) 
    getLastError 
    EXIT '$flow' and signal FAILURE 

The above code works just fine. But, our mapping service requires information from the ISA and GS too. How can I get to this information from the above Flow service? (for example, ISA02, ISA06, GS02, etc). I’ve tried calling envelopeProcess, which works and gives me the ISA, but then when I try calling convertToValues, I get a parse error. What’s the best way to do this?

Thank you very much.

Any ideas guys?

The Reason of parsing error might be the edidata contained in the ST segment level is not well formed or its not matching with the EDIFFSchema provided.

Please check the data/delimiters/Qualifiers are valid and matching with the 810 Schema.

HTH.

Okay, I got it to work, but this doesn’t feel like the best way to do this:

 
getTspace (pull the edidata out of the bizdoc) 
processEnvelope (get the X12env from the edidata, and drop the edidata) 
getTspace (get the edidata again from the bizdoc) 
convertToValues (get the X12 810 document from the edidata) 

The above works, but it feels like a hack. If anyone can suggest a better way to do this, please do.

Thanks.

Robby,

Take a look at wmEDIsamples package there’s an excellent example in there.

Question. Why are you using getTspace, do you have largeDoc enabled?

HTH

Perfect. I guess I should have looked in WmEDISamples first and saved myself a lot of trouble. Now it does exactly what I want. Thanks Chris.

We may need to enable largeDoc, but that’s not why I am using getTspace. Is there a better way to get the EDI data out of the bizdoc? Should I use wm.tn.doc:getContentPart instead?

Use the bizdoc/Content variable to extract the EDI data wich gives bytes and next convert bytesToString (edidata).

And if you enable largeDoc then you need to use the wm.tn.doc.getContentPartData for pulling of the data (getAs stream).

HTH,

You don’t need getTspace unless LargeDoc is enabled.
These links may also help.
http://www.wmusers.com/wmusers/messages/117/966.shtml
http://www.wmusers.com/wmusers/messages/117/982.shtml

just an update,
For retrieving the X12 transation data,check the pipeline BizDoc Envelope containing the docTypeName= X12 4010 (TransactionSet) and use this to get the bizdoc/Content (bytes).