Basic conversion Float to String

Hi,

I have this rudimentary question. Do I need to write my own java service in order to convert Float variable in the pipeline to a String??? I would expect there is something that does that.
But when I have a map step and I just map a Float variable into a String variable the String is empty.
I didn’t find any transformers to do this work.

I am on IS 6.1

TIA

Hi,

Yes I think so, even I couldnot find and hence written my own java service that converts to String. Lets wait and see for the answer in this thread.

Regards,
Kalyan

Hi,
Float values are represented in String variables. No need to convert it again to String variable.
Thanks
Shiv

Hi Shiva,

You statement holds good for the webMethods version 4.6 but not for 6.1

Regards,
Kalyan

Check out the WmTransformationServices Package on Advantage. It has many useful services that have already been written, including a FloatToString. It can be found under Best Practices -> Utilities and Samples.

Tim,

I will check out the services. However my surprise was rather the fact that the map step does not perform this automatic conversion. In fact I have already created a simple one-line java service that takes Object as input and calls toString() on that object and returns the resulting string to the pipeline. This is really easy and I am sure that WmTransformationServices package contains services like that. I was just surprised that when mapping to String value the map step is not converting the source object automatically.

The Enterprise Server with its Enterprise Integrator was more helpful as it did the work automatically…

Thanks.

Can you show us that one line of java code? I’m having the same problem as well with IS6.0.1 with a number from Oracle.

The java service takes an input parameter called object of type Object and returns output parameter called string of type String. The body of the service is

IDataCursor idcPipeline = pipeline.getCursor();

IDataUtil.put( idcPipeline, “string”, IDataUtil.getString( idcPipeline, “object” ) );

idcPipeline.destroy();

The service converts any Object to String, not just Float.

HTH.

the service will not work when u try to convert an xmlnode object
to xml string…try for urself if u dont beleive