If the system is a “black box” for you…

The other day I was working on an XSLT map for webMethods. In that map I needed to calculate a unit price using the gross price and the price basis. I.e. for example if the price is $1,250.00 per thousand, the unit price will be $1250/1000 – $1.25 per unit. Besides the map itself, the system used several pre and post processors for some additional data changes, and I was getting ‘NaN’ instead of expected $1.25. I’m not a big expert in webMethods, I was not sure about all the pre/post processors used, so I did the following: I changed the map to put both the price and the price basis into the text fields (in my case it was X12 810, IT1-04 so I used IT1-07 which is AN1..48). And I found that the price was “1250” (as expected) but the price basis was “TP” (X12 4010, 639 Basis of Unit Price Code, TP = Price per Thousand) instead of “1000”. I.e. the system converted my “1000” into “TP”, that’s why it was ‘NaN’ in the output (1250/TP = NaN). It became clear why I was getting this error and I was able to fix the map. So, often there is a way to make a “black box” a little bit clearer – you just need to redirect you questionable data into text elements.

Gennady Kim

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s