Map values from a "com.wm.util.Values" record

Hi all,

I’ve munged together (using various documentation) a java service that outputs a com.wm.lang.ns.NSService record (as well as some other string records).

(Refer to http://www.wmusers.com/forum/showthread.php?p=46955#post46955 for a history about why I’m doing this, if you’re interested…)

I realise the NSService stuff is “unpublished” API… if anyone knows how to get the package name of a given service more elegantly, please let me know!

After running this service, if I do a pipeline dump to file, the data is clearly visible as a “com.wm.util.Values” record, and it’s correct.

The problem, however, is that I can’t seem to map values from the sub-elements of the document record!

Even though the source element has a string in it, if the target string is empty before it is “overwritten” by the mapping, it is left empty. If it has something in it, that content is not repleaced by the mapping.

I’ve noted that other document records show up in the pipeline as com.wm.data.ISMemDataImpl types. Perhaps I should cast from Values to ISMemDataImpl, but there’s no explicit cast available.

Any help appreciated!!

PS I’m a rank amatuer at Java, even more so with wM and the wM API… if you couldn’t tell already… :wink:

Cheers,
Ben.

The fun part about working with unpublished classes and methods are the surprises you run into. I’m not entirely sure if this is what you’re encountering but sometimes a field within the IData or Values object that looks to be string within Developer at debug time actually isn’t. Therefore, mapping steps don’t work. I can’t recall how many times I’ve run into this and how many times I’ve forgotten about this behavior and have to remember it all over again.

To get around it, you’ll need to drop to Java again and through introspection determine what type the field in question is actually holding. From that, you can determine the best way to convert that to a string for use.

Hope this leads to a solution for you.