Extracting value from Record

Hi Experts,

If I want to extract value of ST/BEG/BEGO1/code from EDIValues Record how should I go about? Is there any service provided which take a path(ST/BEG/BEG01/code) and gives a value.

Thanks in Advance

Uday

just to add to my previous message, the path will be in a variable. Say this path is generated by errors record upon validating the EDIValues record.

Thanks

Use segment mapping.
Or try substituting the value as %ST/BEG/BEG01/code%

thanks VR,

I tried using %pathName% (where path name contains the value ST/BEG/BEG01/code) but in the output variable its putting the contains or pathName variable. I want it to take the value of pathname variable and then evaluate that to extract the value from record.

Uday

First map the ST/BEG/BEG01/code to a new variable(eg. stbegbegcode) Then try %stbegbegcode% where you want to substitute the value.
All the best!

That would be correct when we know what to extract. but as i said it has to take ST/BEG/BEG01/code or ST/REF/… from a variable.

Let me explain you the scenerio. I have a service which does the following things.

  1. envelopeProcess
  2. getTemplate
  3. getEDIString
  4. convertToValues
  5. validate

after executing the validate i’m getting error (which i delibrately generating by altering the EDI) in erros record which had 3 fields 1. pathName which contains where the error occured, 2. Errorcode and 3. BriefMessage.

Now taking the path from pathName field i want to extract the values from the EDIValues record. So the pathName field can contain any value need not be ST/BEG…

Uday,

I’m not sure there’s a way to do what you want because the value is always changing. I ended up creating a flow service that looped through errors and emailed them to an admin account.
If you find a solution I’d be interested to know.

Chris

You can use queryDocument. You need to have a node representation of the EDIValues record that you passed to validate (do recordTODocument, stringToDocument). You can use the pathName as the XQL query.

You could also write a custom Java service that uses an IDataCursor to navigate a variable path.

It’s a little tougher than Rob’s suggestion. But you’ll get beeter performance than the recordToDocument / queryDocument route, especially in the case of a large record (like EDI).

Regards,
Theo