need help generating an FA

ok I have done a lot of searching but I am unsure what is wrong in my service.
I have a service that processes inbound 810s that works fine and has for several months.

I need to generate FA’s but the auto generate (from TN) doesn’t seem to work correctly.
It seems to either be on for all or off for all. I have tried even creating specific TPA’s and creating a new INITservice as well.
It seems the best way is to generate the 997 from inside the 810 service but I am having problems with that.

I use getTspace to pull an EDI 810 from TN.
I then use edi:envelopeProcess.
I later try calling generateFA and use the edidata output of getTSpace as the input and I get various errors. Is the edidata output(from getTSpace) a byte or a stream? I have tried using bytesToString and streamToBytes → bytesToString but I can’t get the edidata to pass the data to generateFA. It keeps thinking the data is null

If I hardcode an 810 into the variable edidata and pass that to the string input for generateFA, it works fine but this doesn’t allow me to actually receive from TN.

Any help would be appreciated.

Why do you use getTspace instead you can extract 810 content from the TN BizDocEnvelope’s bizdoc/content(bytes) from the pipeline and bytesToString (map to edidata)…

AutogenerateFA will also work…may be its something to fix in the TPA settings…There are threads here discussed on it steps…please check it.

HTH,
RMG

Hi rmg, thanks so much for responding so quickly. In regard to getTspace I was new to the team(and WM) at the time and the previous developer went out on maternity leave and it was already working ok so I left it as is.
Is there a way to do it using getTspace or will I need to re-write using your method above?
I’m not sure what you mean when you say " extract 810 content from the TN BizDocEnvelope’s bizdoc/content(bytes) from the pipeline".

In regard to the auto generate, I tried that and even spent a good deal of time working with WM support on it before resorting to coding it myself.

thanks again!

Another way for creating FA’s for specific partners and document types, would be to create a processing rule on the X12 Group document with that specific partners, and invoke a service. The service should extract the EDI data from the bizdoc, and invoke wm.b2b.edi.util:generateFA. This would give you the FA as output, and the rest of the part is delivery, which can be handled with delivery services of TN or custom services

Regards,
Pradeep

“will I need to re-write using your method above”

Yes…its better you can recode in a easier way…as Pradeep flow mentioned above…

Can you try with that?

and your processing rule excute service’s input should be [B]bizdoc/b–set as documentReference

and you can access the 810 edidata from the bizdoc/content var.

HTH,
RMG

thanks everyone for your help. I’ll give these a try and see how it goes.

Pls keep us posted how it goes…

ok, I went back and forth and tried several things. What I ended up doing was using the savePipelinetoFile to see what was happening.

the pipeline showed that my data was in a record with a javaclass of com.wm.app.tn.doc.BizDocContentPart with a PartName of “EDIdata”

So what I did was this (more detail than most might need but it might help someone else):
use the wm.tn.doc:getContentpart and passed it “EDIdata” as the partname.
I then mapped the Bytes variable from the contentPart output to the bytesToString flow. I then took the resulting string and mapped it to a variable I called edidata.
I used that edidata string as input for generateFA to generate my FA.

I also used the edidata string as input to envelopeProcess to convert the edidata to Values. I then had to loop over Values/ISA and loop over Values/ISA/GS and then loop over Values/ISA/GS/ST. Once in that loop I used the edi.util:getEDIString and edi:convertToValues to get it into an EDI document. The rest is just my custom mapping.

thanks again everyone for your help

You are on the right track i believe…thanks!

You really shouldn’t have to do the FA generation yourself. It’s a bummer that support wasn’t able to help configure the TPAs to do the right thing. It does indeed work without you needing to call generateFA yourself.

And you shouldn’t have to call envelopeProcess anywhere either, nor loop over envelopes and transaction sets. It seems that you’re doing more work than you need to be doing on your own. TN should be doing all that.

Rob,

This is just a work around…i know he shouldn’t do this at all when TN generates autoFA…But due to support also not giving clue he took this custom route…

cbor,you dont’t need to use envelopProcess,getEDIString…just extract the EDIdata from the ContentPart and map it to generateFA service edidata along with required inputs and the pipeline o/p should have the valid 997 edidata

HTH,
RMG

RMG, that is what I did. I used envelopeProcess and getEDIstring to do my 810 mapping. I’m having to convert it to XML to load to our backend system.

rmg, I understand. Just voicing the point that this isn’t the normal path.