Extract PO for extended attribute association

Hi, All
I am new here. I am trying to assoicate PO to our EDI 850 transaction in TN.
I need create a service to extract PO. Is there any easy way to do it?
I already test the other steps, associate attribute type to doucument by wm.b2b.editn:addAttributeTypeToBizDoc,
set value to the attribute by wm.tn.doc:setAttribute, save value to TN db by wm.tn.doc:updateAttributes.

Are you trying to relate a source PO document to a resulting 850 document? If so, you can simply use relateDocuments to associate the documents with each other.

We are try to assoicate the surce PO number to transaction for later query. Such as use Transaction Analysis in TN and query by PO number.

Is the PO an XML doc? Is the 850 something that is sent to you or are you creating it?

It’s inbound EDI850 sent by our customer to our TN. It is not be converted to XML yet

The easiest thing to do then is in the service that processes the 850 is to get the PO number from the appropriate segment and then call the setAttribute and updateAttributes that you outlined in your post.

Do I need to put bizDoc in a variable and pass it into 850 process servoice sothat setAttribute and updateAttributes can use it?

TN will automatically create a bizdoc variable in the pipeline. I assume that your service that gets invoked via the TN rule has the bizdoc, receiver and sender variables defined per the TN documentation for creating TN invoked services.

I get it. Thank you very much Reamon!